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>
This commit is contained in:
Tim Blechmann 2025-08-25 09:05:33 +08:00
parent db2bbbb251
commit 1beb09f781
1 changed files with 5 additions and 2 deletions

View File

@ -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