Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

tlein
Copy link
Contributor

@tlein tlein commented Aug 25, 2017

SFML Tasks

  • Rebase PR
  • Review code

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.

@tlein
Copy link
Contributor Author

tlein commented Aug 30, 2017

Note, there is an unrelated build error in iOS so while the CMake configuration should succeed the build will fail. This is expected for this pull request and the build error is discussed in #1271

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:
cmake --build . -- -sdk iphoneos -arch arm64

@eXpl0it3r eXpl0it3r added this to the 2.5 milestone Oct 11, 2017
@eXpl0it3r eXpl0it3r added this to Review & Testing in SFML 2.5.0 Oct 11, 2017
@eXpl0it3r
Copy link
Member

When we add a BSD licensed file, do we need to add a link to the license in our license file? @LaurentGomila

@LaurentGomila
Copy link
Member

LaurentGomila commented Oct 11, 2017

When we add a BSD licensed file, do we need to add a link to the license in our license file?

I'm not sure, but I don't think so.

@tlein
Copy link
Contributor Author

tlein commented Oct 28, 2017

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.

@eXpl0it3r eXpl0it3r self-assigned this Nov 24, 2017
@eXpl0it3r
Copy link
Member

I think it's fine the way it is right now. Can you rebase your PR in order to resolve the conflict? Thanks!

@tlein
Copy link
Contributor Author

tlein commented Nov 27, 2017

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

@JonnyPtn
Copy link
Contributor

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?)

@eXpl0it3r eXpl0it3r moved this from Review & Testing to Ready in SFML 2.5.0 Jan 4, 2018
@eXpl0it3r
Copy link
Member

Merged in b6c1aca

@eXpl0it3r eXpl0it3r closed this Jan 9, 2018
@eXpl0it3r eXpl0it3r moved this from Ready to Merged / Superseded in SFML 2.5.0 Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.5.0
  
Merged / Superseded
Development

Successfully merging this pull request may close these issues.

iOS cmake build should use a toolchain file
4 participants