From ba7c62eed53b2304c54643cbddc29db887fcd869 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 21 Mar 2019 13:14:09 +0100 Subject: 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 --- util/cmake/configurejson2cmake.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util') 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': '$', 'c11': '$', - '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': -- cgit v1.2.3