Explicitly disable bitcode for iOS applications

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 <alexandru.croitor@qt.io>
(cherry picked from commit 1d6ce38a826a7ee18165b4994175c1d5479fd90f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2022-07-12 15:56:47 +02:00 committed by Qt Cherry-pick Bot
parent d7c33f16d9
commit 7314ac91fd

View File

@ -1107,12 +1107,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}")