summaryrefslogtreecommitdiffstats
path: root/cmake/QtFeature.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/QtFeature.cmake')
-rw-r--r--cmake/QtFeature.cmake19
1 files changed, 14 insertions, 5 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake
index 75a9d91560..7f4a9d8b52 100644
--- a/cmake/QtFeature.cmake
+++ b/cmake/QtFeature.cmake
@@ -544,10 +544,10 @@ function(qt_feature_module_end)
# Evaluate custom cache assignments.
foreach(cache_var_name ${__QtFeature_custom_enabled_cache_variables})
- set(${cache_var_name} ON CACHE BOOL "Force enabled by platform." FORCE)
+ set(${cache_var_name} ON CACHE BOOL "Force enabled by platform requirements." FORCE)
endforeach()
foreach(cache_var_name ${__QtFeature_custom_disabled_cache_variables})
- set(${cache_var_name} OFF CACHE BOOL "Force disabled by platform." FORCE)
+ set(${cache_var_name} OFF CACHE BOOL "Force disabled by platform requirements." FORCE)
endforeach()
set(enabled_public_features "")
@@ -890,9 +890,8 @@ function(qt_get_platform_try_compile_vars out_var)
# Pass darwin specific options.
# The architectures need to be passed explicitly to project-based try_compile calls even on
# macOS, so that arm64 compilation works on Apple silicon.
- if(CMAKE_OSX_ARCHITECTURES)
- list(GET CMAKE_OSX_ARCHITECTURES 0 osx_first_arch)
-
+ qt_internal_get_first_osx_arch(osx_first_arch)
+ if(osx_first_arch)
# Do what qmake does, aka when doing a simulator_and_device build, build the
# target architecture test only with the first given architecture, which should be the
# device architecture, aka some variation of "arm" (armv7, arm64).
@@ -909,6 +908,16 @@ function(qt_get_platform_try_compile_vars out_var)
set("${out_var}" "${flags_cmd_line}" PARENT_SCOPE)
endfunction()
+# Set out_var to the first value of CMAKE_OSX_ARCHITECTURES.
+# Sets an empty string if no architecture is present.
+function(qt_internal_get_first_osx_arch out_var)
+ set(value "")
+ if(CMAKE_OSX_ARCHITECTURES)
+ list(GET CMAKE_OSX_ARCHITECTURES 0 value)
+ endif()
+ set(${out_var} "${value}" PARENT_SCOPE)
+endfunction()
+
function(qt_config_compile_test_x86simd extension label)
if (DEFINED TEST_X86SIMD_${extension})
return()