summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Blechmann <tim.blechmann@qt.io>2025-08-25 09:05:33 +0800
committerTim Blechmann <tim.blechmann@qt.io>2025-09-08 04:05:34 +0000
commit1beb09f7811550b192e467d9565e8f69dce393c5 (patch)
treeb1fedfb1ed70422e741ca52bd662590bfbcdf117
parentdb2bbbb251c041b37d529e5722c4f4a244988857 (diff)
CMake: x86intrin - prevent re-configure failure with UBs
When configuring a build folder the first time for universal binaries, it works fine. When reconfiguring the build folder, we run into: ``` CMake Error at qtbase/cmake/QtBuildInformation.cmake:554 (message): Feature "x86intrin": Forcing to "ON" breaks its condition: ( ( ( TEST_architecture_arch STREQUAL i386 ) OR ( TEST_architecture_arch STREQUAL x86_64 ) ) AND ( QT_FORCE_FEATURE_x86intrin OR TEST_x86intrin ) ) Condition values dump: TEST_architecture_arch = "arm64" TEST_architecture_arch = "arm64" QT_FORCE_FEATURE_x86intrin = "ON" TEST_x86intrin = "ON" Call Stack (most recent call first): qtbase/cmake/QtFeature.cmake:786 (qt_configure_add_report_error) qtbase/cmake/QtFeature.cmake:923 (qt_feature_check_and_save_internal_value) qtbase/cmake/QtFeature.cmake:1192 (qt_evaluate_feature) qtbase/cmake/QtBaseGlobalTargets.cmake:136 (qt_feature_module_end) qtbase/cmake/QtBaseHelpers.cmake:254 (include) qtbase/CMakeLists.txt:36 (qt_internal_qtbase_build_repo) ``` Can prevent this by adding a special case to detect universal macos builds with x86_64 among the targets Change-Id: If905e21f3cd87609188c6bc71bf69e9595279140 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--configure.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.cmake b/configure.cmake
index 49cb0baaa64..23a207be396 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -831,8 +831,11 @@ qt_feature("signaling_nan" PUBLIC
)
qt_feature("x86intrin" PRIVATE
LABEL "Basic"
- CONDITION (((TEST_architecture_arch STREQUAL i386) OR (TEST_architecture_arch STREQUAL x86_64))
- AND (QT_FORCE_FEATURE_x86intrin OR TEST_x86intrin))
+ CONDITION
+ ( (TEST_architecture_arch STREQUAL i386)
+ OR (TEST_architecture_arch STREQUAL x86_64)
+ OR (QT_IS_MACOS_UNIVERSAL AND x86_64 IN_LIST CMAKE_OSX_ARCHITECTURES))
+ AND (QT_FORCE_FEATURE_x86intrin OR TEST_x86intrin)
AUTODETECT NOT WASM
)
qt_feature("sse2" PRIVATE