summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-03-21 13:14:09 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-03-21 17:47:01 +0000
commitba7c62eed53b2304c54643cbddc29db887fcd869 (patch)
treed2d91e7c3489c576569df8f7aafb97fdace0952e /util
parent25f67fbb073c8bedf26e165f52abacf3e20a6a94 (diff)
Fix sub-architecture (instruction sets / SIMD) handling
In qmake there are at least 2 things to know regarding sub-architectures and instruction sets. Which instruction sets does the compiler know to compile for, represented by the various config.tests and features in qtbase/configure.json. And which instructions sets are enabled by the compiler by default, represented by the configure.json "architecture" test and accessed via QT_CPU_FEATURES.$$arch qmake argument. Before this patch there was some mishandling of the above concepts in CMake code. The former can now be checked in CMake with via TEST_subarch_foo and QT_FEATURE_foo (where foo is sse2, etc). The latter can now be checked by TEST_arch_${TEST_architecture_arch}_subarch_foo (where foo is sse2, etc and the main arch is dynamyicall evaluated). The configurejson2cmake script was adjusted to take care of the above changes, and the cmake files were regenerated as well. Change-Id: Ifbf558242e320cafae50da388eee56fa5de2a50c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/configurejson2cmake.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py
index fe2bf50eaa..eb3fd606fe 100755
--- a/util/cmake/configurejson2cmake.py
+++ b/util/cmake/configurejson2cmake.py
@@ -117,7 +117,7 @@ def map_tests(test: str) -> str:
'c99': '$<COMPILE_FEATURES:c_std_99>',
'c11': '$<COMPILE_FEATURES:c_std_11>',
- 'x86SimdAlways': 'ON', # FIXME: Is this the right thing?
+ 'x86SimdAlways': 'ON', # FIXME: Make this actually do a compile test.
'aesni': 'TEST_subarch_aes',
'avx': 'TEST_subarch_avx',
@@ -333,7 +333,8 @@ def map_condition(condition):
substitution = 'QT_FEATURE_{}'.format(featureName(match.group(2)))
elif match.group(1) == 'subarch':
- substitution = 'TEST_subarch_{}'.format(match.group(2))
+ substitution = 'TEST_arch_{}_subarch_{}'.format("${TEST_architecture_arch}",
+ match.group(2))
elif match.group(1) == 'call':
if match.group(2) == 'crossCompile':