From 9aa4dca6edb3747d7357b84b37603ec30e214468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 12 Jul 2022 15:56:47 +0200 Subject: [PATCH] Explicitly disable bitcode for iOS applications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We disabled building Qt with bitcode in e27a0d5a0f8818653ff125409db81, but the default in Xcode 13 is still to build applications with bitcode, leading to build issues when built against a non-bitcode-enabled Qt. For qmake we already explicitly disable bitcode, so do the same for CMake. Change-Id: I3fd542373c3e1326eb1088a173e70955e61ff608 Reviewed-by: Alexandru Croitor (cherry picked from commit 1d6ce38a826a7ee18165b4994175c1d5479fd90f) Reviewed-by: Tor Arne Vestbø --- src/corelib/Qt6CoreMacros.cmake | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 9b4f255de6c..cb7ddf8d818 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1174,12 +1174,32 @@ function(_qt_internal_generate_ios_info_plist target) set_target_properties("${target}" PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${info_plist_out}") 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_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_handle_ios_launch_screen("${target}") _qt_internal_set_placeholder_apple_bundle_version("${target}")