CMake: disable the attempt to force SIMD on iOS simulator builds

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ø <tor.arne.vestbo@qt.io>
This commit is contained in:
Thiago Macieira 2021-12-20 10:07:05 -08:00
parent dedf11a53b
commit 500c116ced
3 changed files with 4 additions and 21 deletions

View File

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

View File

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

View File

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