Closed Linux13524 closed 3 years ago
Hi, thanks for the PR.
I did start working on making darwin-toolchain work with Apple M1, but got lost into build/host context issues. I encountered this issue and did not update the code once the feature was implemented 😅
Note that it is very possible that you run into M1 specific issues with the current version of darwin-toolchain!
Hi. Nice to hear you already started working on the Apple M1 compatibility!
So you would say this is not as simple as the fix I added here in this pull request? Im not very familar with the Apple architectures I have to say.
I did put it on the backburner for months though, as M1 Macs come with Rosetta2 which make x86 programs compatible.
The main issue you might face is not really Conan-related, it has to do with iOS simulators having the same architecture than iOS devices. This is the exact issue you faced, since Conan only recognized the armv8
arch and assumed it was building for iOS.
If you are using lipo
for example, you will have to transition to XCFrameworks
instead, as you are not allowed to have the same architecture multiple times in a fat library.
Also, many Xcode projects use the following line in their .xcconfig
file:
EXCLUDED_ARCHS[sdk=iphonesimulator*] = 'arm64'
@Linux13524 The Homebrew seems to get stuck, could you upgrade the xcode image to osx_image: xcode12
?
Thanks for all the insights! I upgraded the CI image.
@lasote 👋 Sorry to pull you in, but since you made the CI of this I'd like to know if you could help me understand how I should fix the job failure 😛
Traceback (most recent call last):
File "build.py", line 1, in <module>
from conan.packager import ConanMultiPackager
ModuleNotFoundError: No module named 'conan.packager'
By the way, it might be time to move this recipe to CCI?
@Linux13524 I think I have it, could you change build.py
to import from cpt.packager import ConanMultiPackager
instead?
@theodelrieu Cool, that worked!
@Linux13524 Thank you!
@Linux13524 I can't deploy the new release since Bintray died a few weeks ago, I'm on vacation until next week, I will open a PR to conan-center-index to add darwin-toolchain
to it
@theodelrieu Ok, thanks a lot for your efforts!
@theodelrieu awesome to see you are working on the cross platform support. I was following your comments on an issue in Conan repo. I have transitioned to .xcframeworks and it's frankly a lesser hassle. I do use the EXCLUDED_ARCHS[sdk=iphonesimulator*] = 'arm64'
for now. Eagerly waiting on the M1 cross-platform support.
Is there a reason the
os.sdk
setting was not yet passed toapple_deployment_target_flag
?I tried to build a simple test project with the following profile, but got an error:
The error was:
ld: building for iOS, but linking in object file (CMakeFiles/test.dir/src/main.cpp.o) built for iOS Simulator, file 'CMakeFiles/test.dir/src/main.cpp.o' for architecture arm64
Adding
os.sdk
setting to thetools.apple_deployment_target_flag()
function fixes it.