Explicitly disable bitcode for iOS applications

We disabled building Qt with bitcode in e27a0d5a0f,
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.

Pick-to: 6.2 6.3 6.4
Change-Id: I3fd542373c3e1326eb1088a173e70955e61ff608
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tor Arne Vestbø 2022-07-12 15:56:47 +02:00
parent 9a45a01a2c
commit 1d6ce38a82

View File

@ -1118,12 +1118,32 @@ 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_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}")