diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-06-26 17:04:49 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-06-29 16:16:08 +0000 |
commit | 38bb125aae3ac592434446b8b02d14d4ef5618c0 (patch) | |
tree | 33e7e53253bf955e498ddfc28ff0cc031849f5ce /share/qbs/modules/cpp/GenericGCC.qbs | |
parent | 6c9aa189aa9f3a83cd1efc3b9b350a8d0be87cf6 (diff) |
Re-introduce endianness property
Now it can actually be useful, in order to select a specific endianness
when building for architectures that are bi-endian. For example, MIPS
and PowerPC.
This patch makes it possible to build for ppc64le, which is the only
variant of the PowerPC architecture that seems to be relevant today.
ppc32 and all big-endian variants seem to have fallen out of use.
Change-Id: Id1b9f9b397990136ab9aa899829345d426465824
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/GenericGCC.qbs')
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index 228efee26..7a065702e 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -96,6 +96,7 @@ CppModule { } qbs.architecture: gccProbe.found ? gccProbe.architecture : original + endianness: gccProbe.endianness compilerVersionMajor: gccVersionProbe.versionMajor compilerVersionMinor: gccVersionProbe.versionMinor @@ -113,7 +114,8 @@ CppModule { ? [targetArch, targetVendor, targetSystem, targetAbi].join("-") : undefined property string targetArch: Utilities.canonicalTargetArchitecture( - qbs.architecture, targetVendor, targetSystem, targetAbi) + qbs.architecture, endianness, + targetVendor, targetSystem, targetAbi) property string targetVendor: "unknown" property string targetSystem: "unknown" property string targetAbi: "unknown" @@ -284,6 +286,15 @@ CppModule { "may not be supported by this compiler."); } + if (gccProbe.endianness) { + validator.addCustomValidator("endianness", endianness, function (value) { + return endianness === gccProbe.endianness; + }, "'" + endianness + "' differs from the endianness produced by this compiler (" + + gccProbe.endianness + ")"); + } else if (endianness) { + console.warn("Could not detect endianness ('" + endianness + "' given)"); + } + var validateFlagsFunction = function (value) { if (value) { for (var i = 0; i < value.length; ++i) { |