leetal / ios-cmake

A CMake toolchain file for iOS/iPadOS, visionOS, macOS, watchOS & tvOS C/C++/Obj-C++ development
BSD 3-Clause "New" or "Revised" License
1.91k stars 450 forks source link

Disable bitcode support by default #174

Closed ealeksandrov closed 1 year ago

ealeksandrov commented 1 year ago

When I tried to merge compiled static libraries into a single XCFramework, xcodebuild errored for me with something that looks like a bitcode shorthand:

❯ xcodebuild -create-xcframework -library lib-ios-arm64.a -output lib.xcframework
error: unable to find any architecture information in the binary at '.../lib-ios-arm64.a': Unknown header: 0xb17c0de

After some research, I've found that ios-cmake enables bitcode support by default, and I don't think we'll need it after Apple officially deprecated bitcode in 2022.:

Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.

Xcode no longer builds bitcode by default and generates a warning message if a project explicitly enables bitcode: “Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode.” The capability to build with bitcode will be removed in a future Xcode release. IPAs that contain bitcode will have the bitcode stripped before being submitted to the App Store. Debug symbols can only be downloaded from App Store Connect / TestFlight for existing bitcode submissions and are no longer available for submissions made with Xcode 14. (86118779)

https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes

I've only changed default parameter value in this PR, but should we fully remove bitcode support instead?