-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add iOS Cross-Compilation Support #461
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Treata11 <[email protected]>
Thanks for thinking of this. I think it would be great to support create an ios framework as you propose, but I'm thinking it would be preferable to base it on the native cmake facilities for ios. As far as I understand it the leetal toolchain files are meant to support old cmake versions. We specify cmake 3.14, which I think is new enough to natively support iOS. https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html |
Replaced `TBB_USE_APPLE_FRAMEWORKS` with `IMATH_BUILD_APPLE_FRAMEWORKS`. Signed-off-by: Treata <[email protected]>
Thanks for the tips @meshula !
I wasn't able to produce iOS frameworks with the native CMake 3.14 flags... Are any adjustments in project's settings required for that? |
I'd really prefer not to have to ask people to use a toolchain file as it really complicates builds of systems with many components, so hopefully it's possible with CMake. I'm unclear if we need to bump to a later CMake version, or if there's a deeper problem. Adding @dgovil for advice, as he's been deep into producing cmake based framework builds for other projects recently. |
You shouldn't need toolchains if using recent CMake versions like 3.19 for iOS I believe and 3.28 for visionOS. You can just set the CMAKE_SYSTEM_NAME to the appropriate platform version, and it'll find the correct SDK toolchain for you automatically. |
Thanks! If 3.19 works, we could bump the min version. |
Greetings,
Cross-compilation for a macOS target was already supported within this framework. To enable iOS compilations, I've introduced a new flag, IMATH_BUILD_APPLE_FRAMEWORKS, which is set to FALSE by default.
This implementation relies on the iOS-CMake toolchain for building.
Specifically, the following command can be used to build the project for iOS:
Once built, the project can be installed using:
The resulting iOS binaries can then be found in:
build/src/Imath/Release-iphoneos/Imath-3_2.framework
.