ios-cmake
ios-cmake copied to clipboard
iOS combined builds are broken in Xcode 13.2.1 [bug]
Describe the bug When building the example library with PLATFORM=OS64COMBINED, a binary containing only arm64 is produced. I was also unable to manually persuade Xcode to build a fat archive from the generated Xcode project; it seems to only build the selected architecture.
To Reproduce Steps to reproduce the behavior:
- cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64COMBINED
- cmake --build .
- objdump -s Debug-iphoneos/libexample.a (produces Debug-iphoneos/libexample.a(HelloWorldIOS.o): file format mach-o arm64)
Expected behavior I expected a FAT archive containing x86_64 and also arm64.
Environment
- What version of CMake did you run? 3.22.2
- Your faulty CMakeLists.txt here:
< the example-lib CMakeLists.txt >
Xcode will build for x86_64 separately, if manually opened and instructed to build for the simulator. Doesn't seem to build a fat archive.
I didn't do the install step.
I met the same issue. It can't generate a fat library but a arm64 library.
My cmake version is 3.23.2
I guess #156 is the same issue too.
@SirWhiteHat I think I found the reason. We all didn't do the install step.
When I add install scrip as the example code and run cmake --install ., it generate the fat archive in the destination.
ps: my xcode version is 13.4.1
Please note that the combined builds have always required the install step in one way or another. This is due to the way Kitware constructed CMake to work. I've reviewed the PR fixing the README (I'll admit that it was NOT obvious at all that the install step was necessary...), so hopefully it will be a little more clear for any future users.
I’m thinking the same. I’ve put in a pull request to update the documentation to make it clearer that the install step is needed. I wonder if it has always been needed or if that’s a new thing?
On Thu, 18 Aug 2022 at 11:02, Darwin.Lv @.***> wrote:
@SirWhiteHat https://github.com/SirWhiteHat I think I found the reason. We all didn't do the install step.
When I add install scrip as the example code and run cmake --install ., it generate the fat archive in the destination.
ps: my xcode version is 13.4.1
— Reply to this email directly, view it on GitHub https://github.com/leetal/ios-cmake/issues/154#issuecomment-1219296532, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABALGXXR2IIQ234OZMKRD5TVZYC2VANCNFSM56QXLV5A . You are receiving this because you were mentioned.Message ID: @.***>
Closing this since the install step is required.