From 23df775c56e75b092b2418ee0e0c733a5eb4178b Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 30 Sep 2022 14:57:03 +0300 Subject: [PATCH] Remove bitcode from iOS/tvOS/watchOS binaries as required by https://developer.apple.com/documentation/Xcode-Release-Notes/xcode-14-release-notes. --- CMake/iOS.cmake | 7 ++----- example/ios/Python-Apple-support.patch | 17 +++++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CMake/iOS.cmake b/CMake/iOS.cmake index 4c1e3065f..935139542 100644 --- a/CMake/iOS.cmake +++ b/CMake/iOS.cmake @@ -136,12 +136,9 @@ if (IOS_DEPLOYMENT_TARGET) endif() set (CMAKE_SHARED_LINKER_FLAGS_INIT "-fapplication-extension") -if (NOT SIMULATOR_FLAG) - set (BITCODE "-fembed-bitcode") -endif() -set (CMAKE_C_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE}") +set (CMAKE_C_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS}") # Hidden visibilty is required for cxx on iOS -set (CMAKE_CXX_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fvisibility-inlines-hidden") +set (CMAKE_CXX_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fvisibility-inlines-hidden") set (CMAKE_C_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fapplication-extension -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") set (CMAKE_CXX_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fapplication-extension -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") diff --git a/example/ios/Python-Apple-support.patch b/example/ios/Python-Apple-support.patch index 65845102c..1532d1216 100644 --- a/example/ios/Python-Apple-support.patch +++ b/example/ios/Python-Apple-support.patch @@ -33,9 +33,12 @@ index 695be54..4efe5e5 100644 -TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.i386 iphoneos.armv7 iphoneos.armv7s iphoneos.arm64 +TARGETS-iOS=iphoneos.armv7 iphoneos.armv7s iphoneos.arm64 CFLAGS-iOS=-mios-version-min=7.0 - CFLAGS-iphoneos.armv7=-fembed-bitcode - CFLAGS-iphoneos.armv7s=-fembed-bitcode - CFLAGS-iphoneos.arm64=-fembed-bitcode +-CFLAGS-iphoneos.armv7=-fembed-bitcode +-CFLAGS-iphoneos.armv7s=-fembed-bitcode +-CFLAGS-iphoneos.arm64=-fembed-bitcode ++CFLAGS-iphoneos.armv7= ++CFLAGS-iphoneos.armv7s= ++CFLAGS-iphoneos.arm64= +# iOS-simulator targets +TARGETS-iOS-simulator=iphonesimulator.x86_64 iphonesimulator.i386 iphonesimulator.arm64 @@ -45,7 +48,8 @@ index 695be54..4efe5e5 100644 -TARGETS-tvOS=appletvsimulator.x86_64 appletvos.arm64 +TARGETS-tvOS=appletvos.arm64 CFLAGS-tvOS=-mtvos-version-min=9.0 - CFLAGS-appletvos.arm64=-fembed-bitcode +-CFLAGS-appletvos.arm64=-fembed-bitcode ++CFLAGS-appletvos.arm64= PYTHON_CONFIGURE-tvOS=ac_cv_func_sigaltstack=no +# tvOS-simulator targets @@ -56,8 +60,9 @@ index 695be54..4efe5e5 100644 -TARGETS-watchOS=watchsimulator.i386 watchos.armv7k +TARGETS-watchOS=watchos.armv7k watchos.arm64_32 CFLAGS-watchOS=-mwatchos-version-min=4.0 - CFLAGS-watchos.armv7k=-fembed-bitcode -+CFLAGS-watchos.arm64_32=-fembed-bitcode +-CFLAGS-watchos.armv7k=-fembed-bitcode ++CFLAGS-watchos.armv7k= ++CFLAGS-watchos.arm64_32= PYTHON_CONFIGURE-watchOS=ac_cv_func_sigaltstack=no +# watchOS-simulator targets