diff options
Diffstat (limited to 'src/corelib/Qt6CoreMacros.cmake')
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 6ef5eda713..141d0598c1 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1097,6 +1097,21 @@ function(_qt_internal_set_xcode_code_sign_style target) endif() endfunction() +# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/15183 +function(_qt_internal_set_xcode_install_path target) + if(NOT CMAKE_XCODE_ATTRIBUTE_INSTALL_PATH + AND NOT QT_NO_SET_XCODE_INSTALL_PATH) + get_target_property(existing_install_path + "${target}" XCODE_ATTRIBUTE_INSTALL_PATH) + if(NOT existing_install_path) + set_target_properties("${target}" + PROPERTIES + XCODE_ATTRIBUTE_INSTALL_PATH + "$(inherited)") + endif() + endif() +endfunction() + function(_qt_internal_set_xcode_bundle_display_name target) # We want the value of CFBundleDisplayName to be ${PRODUCT_NAME}, but we can't put that # into the Info.plist.in template file directly, because the implicit configure_file(Info.plist) @@ -1107,15 +1122,63 @@ function(_qt_internal_set_xcode_bundle_display_name target) set(QT_INTERNAL_DOLLAR_VAR "$" CACHE STRING "") endfunction() +function(_qt_internal_set_xcode_bitcode_enablement target) + if(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE + OR QT_NO_SET_XCODE_ENABLE_BITCODE) + return() + endif() + + get_target_property(existing_bitcode_enablement + "${target}" XCODE_ATTRIBUTE_ENABLE_BITCODE) + if(NOT existing_bitcode_enablement MATCHES "-NOTFOUND") + return() + endif() + + # Disable bitcode to match Xcode 14's new default + set_target_properties("${target}" + PROPERTIES + XCODE_ATTRIBUTE_ENABLE_BITCODE + "NO") +endfunction() + +function(_qt_internal_set_ios_simulator_arch target) + if(CMAKE_XCODE_ATTRIBUTE_ARCHS + OR QT_NO_SET_XCODE_ARCHS) + return() + endif() + + get_target_property(existing_archs + "${target}" XCODE_ATTRIBUTE_ARCHS) + if(NOT existing_archs MATCHES "-NOTFOUND") + return() + endif() + + if(NOT x86_64 IN_LIST QT_OSX_ARCHITECTURES) + return() + endif() + + if(CMAKE_OSX_ARCHITECTURES AND NOT x86_64 IN_LIST CMAKE_OSX_ARCHITECTURES) + return() + endif() + + set_target_properties("${target}" + PROPERTIES + "XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*]" + "x86_64") +endfunction() + function(_qt_internal_finalize_ios_app target) _qt_internal_set_xcode_development_team_id("${target}") _qt_internal_set_xcode_bundle_identifier("${target}") _qt_internal_set_xcode_targeted_device_family("${target}") _qt_internal_set_xcode_code_sign_style("${target}") _qt_internal_set_xcode_bundle_display_name("${target}") + _qt_internal_set_xcode_bitcode_enablement("${target}") + _qt_internal_set_xcode_install_path("${target}") _qt_internal_handle_ios_launch_screen("${target}") _qt_internal_set_placeholder_apple_bundle_version("${target}") + _qt_internal_set_ios_simulator_arch("${target}") endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) @@ -2484,6 +2547,7 @@ macro(_qt_internal_override_example_install_dir_to_dot) # to CMAKE_INSTALL_PREFIX. if(QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT) set(INSTALL_EXAMPLEDIR ".") + set(_qt_internal_example_dir_set_to_dot TRUE) endif() endmacro() |