From 500c116ced9ab8d9dbcf4d71aeb150b5cda54a0d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 20 Dec 2021 10:07:05 -0800 Subject: [PATCH] CMake: disable the attempt to force SIMD on iOS simulator builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will stop working with the next commit, which merges all basic x86 SIMD intrinsics into one configure test. As a result, linking almost anything graphical on iOS (which is almost everything) causes the linker to fail with undefined references to SIMD-optimized versions that didn't get compiled. Change-Id: Ib42b3adc93bf4d43bd55fffd16c288f4104a6ccc Reviewed-by: Tor Arne Vestbø --- cmake/QtBaseGlobalTargets.cmake | 7 ++++--- cmake/QtInternalTargets.cmake | 9 --------- mkspecs/features/uikit/default_pre.prf | 9 --------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index a81c6cbcfc8..cec440dd917 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -87,9 +87,10 @@ include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") qt_internal_get_first_osx_arch(__qt_osx_first_arch) set(__qt_apple_silicon_arches "arm64;arm64e") -if((UIKIT AND NOT QT_UIKIT_SDK) - OR (MACOS AND QT_IS_MACOS_UNIVERSAL - AND __qt_osx_first_arch IN_LIST __qt_apple_silicon_arches)) +if(MACOS AND QT_IS_MACOS_UNIVERSAL + AND __qt_osx_first_arch IN_LIST __qt_apple_silicon_arches) + # The test in configure.cmake will not be run, but we know that + # the compiler supports these intrinsics set(QT_FORCE_FEATURE_sse2 ON CACHE INTERNAL "Force enable sse2 due to platform requirements.") set(__QtFeature_custom_enabled_cache_variables TEST_subarch_sse2 diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index e707a2a91c0..bf7ef3cf363 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -214,15 +214,6 @@ if(MSVC) endif() if(UIKIT) - # Do what mkspecs/features/uikit/default_pre.prf does, aka enable sse2 for - # simulator_and_device_builds. - if(FEATURE_simulator_and_device) - # Setting the definition on PlatformCommonInternal behaves slightly differently from what - # is done in qmake land. This way the define is not propagated to tests, examples, or - # user projects built with qmake, but only modules, plugins and tools. - # TODO: Figure out if this ok or not (sounds ok to me). - target_compile_definitions(PlatformCommonInternal INTERFACE QT_COMPILER_SUPPORTS_SSE2) - endif() qt_internal_apply_bitcode_flags(PlatformCommonInternal) endif() diff --git a/mkspecs/features/uikit/default_pre.prf b/mkspecs/features/uikit/default_pre.prf index bc729365204..4a7c0820d00 100644 --- a/mkspecs/features/uikit/default_pre.prf +++ b/mkspecs/features/uikit/default_pre.prf @@ -7,15 +7,6 @@ $$sim_and_dev|contains(QMAKE_MAC_SDK, ^$${device.sdk}.*): \ $$sim_and_dev|contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \ CONFIG += simulator $${simulator.sdk} -$$sim_and_dev { - # For a simulator_and_device build all the config tests - # are based on the device's ARM SDK, but we know that the simulator - # is Intel and that we support SSE/SSE2. - QT_CPU_FEATURES.$$QT_ARCH += sse sse2 - CONFIG += sse sse2 - DEFINES += QT_COMPILER_SUPPORTS_SSE2 -} - CONFIG += entrypoint unset(sim_and_dev)