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
Use a CMake toolchain file for iOS build #1269
Conversation
This PR has been rebased to include the fix for this build error and the build can be checked by using this command in the build/ios directory referenced in the top comment instructions: |
When we add a BSD licensed file, do we need to add a link to the license in our license file? @LaurentGomila |
I'm not sure, but I don't think so. |
I don't think it's necessary, but adding a link to it or just saying "iOS toolchain file licensed under BSD" in license.md wouldn't hurt. If you want I could go ahead and add that in this PR. |
I think it's fine the way it is right now. Can you rebase your PR in order to resolve the conflict? Thanks! |
34e9a85
to
c144e28
Compare
Did the rebase. Turns out I had not yet added the BSD license like I had claimed, my mistake. Went ahead and added the license found in the toolchain repository to the top of iOS.toolchain.cmake |
I've tested this and it's great in comparison to the current method (Audio also worked, so what's outstanding for that to be included again?) |
Merged in b6c1aca |
SFML Tasks
Resolves #1268
Description
This changes SFML to use a toolchain file when building for iOS instead of managing all the necessary CMake values for iOS build itself. This is the standard pattern for cross compiling CMake projects and is used by SFML for Android build.
This updated the audio package as well even though it is currently being excluded from iOS so once that is fixed this will be compatible with the audio package.
The CMake file was taken from https://github.com/jomof/ios-cmake. The license is BSD and I included it at the top of the toolchain file.
Follow ups
The tutorial on the wiki should be updated once this PR is in to reference the toolchain file instead of the IOS=True variable.
Testing
Open a terminal in the SFML folder and run these commands:
mkdir build && mkdir build/ios && mkdir build/ios-install
cd build/ios
cmake ../.. -DCMAKE_INSTALL_PREFIX=../ios-install/ -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/iOS.toolchain.cmake -G Xcode
cmake --build . -- -sdk iphoneos -arch arm64
The configuration and build should complete without a problem.