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

Adds support for combined + ASi support #153

Closed objectivecosta closed 1 year ago

objectivecosta commented 2 years ago

Adds support for combined + ASi support

hjmallon commented 2 years ago

I don't think lipo can join arm64-device and arm64-simulator binaries, does this work?

kambala-decapitator commented 2 years ago

I don't think lipo can join arm64-device and arm64-simulator binaries, does this work?

I thought the intention of the PR is to produce fat simulator builds, but two arm64 slices definitely can't be combined with lipo

hjmallon commented 2 years ago
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64")
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64 arm64")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "arm64")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "x86_64 arm64")

It looks to me like it is trying to use CMAKE_IOS_INSTALL_COMBINED to make a arm64-device/arm64-sim/x86_64-sim combined binary. Also the name OS64COMBINED_ASI would match that.

I don't think this can work, unless CMake upstream integrated some fairly complete version of xcframework support (i.e. super fat structures with separate simulator and device binaries inside).

Fat arm64/x86_64 simulator builds is possible though (i.e. SIMULATORUNIVERSAL2 or SIMULATORARM64X8664 or something).

objectivecosta commented 2 years ago

Sorry for the delay... @hjmallon is correct, I wanted to create a fat version with everything possible. I think it is doable, don't know if .xcframework is needed.

I'm gonna go back to working on it and I'll get back here ;)

leetal commented 1 year ago

Closed in favour of #178. Please create a new PR based off the latest master if still needed.