diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2015-07-08 14:43:40 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@petroules.com> | 2015-07-09 08:11:45 +0000 |
commit | 074bf27f29eec1359e4669d3bbfa01dd6419841c (patch) | |
tree | 12d0b78db71931ad82b8193ac8dd90622d6156d4 /share/qbs/modules/cpp/CppModule.qbs | |
parent | ee02724725c27e817904697d3acef939381b468d (diff) |
Make qbs.architecture an optional property.
The value "undefined" now indicates an architecture-independent target
like the CLR or JVM.
The cpp module's copy of the architecture property is not required
unconditionally either, because there exist implementations that compile
C/C++ to architecture-independent targets (Emscripten). However it
remains required for GCC and MSVC toolchains where a specific
architecture is always targeted.
Change-Id: I0810e71bd561d3b9bc1f83d70329ee78d129e9db
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'share/qbs/modules/cpp/CppModule.qbs')
-rw-r--r-- | share/qbs/modules/cpp/CppModule.qbs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index bd92f680a..62b6659aa 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -286,6 +286,15 @@ Module { fileTags: ["hpp"] } + validate: { + var validator = new ModUtils.PropertyValidator("cpp"); + validator.addCustomValidator("architecture", architecture, function (value) { + return !architecture || architecture === canonicalArchitecture(architecture); + }, "'" + architecture + "' is invalid. You must use the canonical name '" + + canonicalArchitecture(architecture) + "'"); + validator.validate(); + } + setupRunEnvironment: { var env = qbs.commonRunEnvironment; for (var i in env) { |