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
Android: Removed custom toolchain + NDK updates #1350
Conversation
Just to avoid confusion, the Android CI builds are supposed to fail, since variable names have changed. |
4702e26
to
8e6f647
Compare
Don't forget to provide an updated config for the CI, so it will build fine again after this is merged. |
Now if I'd know how to do so specifically and how to actually test it… Setup should be similar trivial though, something like this (not sure it should use extra variables for this):
|
Android build fails. @MarioLiebisch, can you look into what needs to be changed and tell @binary1248 if there are some CI changes needed or @mantognini if there are some build changes needed? |
Works fine under linux. But I could not get it working with the CMake-Gui, not sure if this is a important concern, because the user has to use the command line to compile SFML anyways? |
See my comment above. It just needs different defines and no longer uses the custom toolchain file. @AlexAUT Can you be more specific? What exactly fails? You'll have to define the variables I've mentioned, but then it should work even with the GUI version. |
Point is, I don't run the CI, so you don't have to tell me, but you need to tell @binary1248, at best make a pull request on the config repo. @AlexAUT has already created an issue there. |
As mentioned above, I can't. I have no idea how the configuration works or how to even test it so it would be at best what I provided in the comment. |
My issue already contains the fixes to the CI, with one small unsolved problem, when binary comments, I'm gonna do the PR (just two lines of code) CMake-Gui: |
Update: |
CI is fixed. |
This commit drops the previous custom CMake toolchain file for Android in favor of CMake's new built-in toolchain for this (CMake >3.7.2). This makes building SFML for Android a lot simpler and more straight forward, working almost as smooth as other platforms. To configure your build directory, all you have to do is defining just a few variables the first time you invoke CMake. **Required Variables** * `CMAKE_SYSTEM_NAME` must be `Android`, so CMake knows we actually want to cross-compile. * `CMAKE_ANDROID_NDK` must point to the NDK's installation directory, e.g. `/usr/android/ndk` or `c:/android/ndk`. **Recommended Variables** * `CMAKE_ANDROID_STL_TYPE` defines the STL implementation to be used. You should use `c++_shared`, although others might work. **Optional Variables** * `CMAKE_SYSTEM_VERSION` can be set to pick a specific SDK version other than the latest. * `CMAKE_ANDROID_ARCH_ABI` defines the target architecture and ABI, for example `armeabi` or `armeabi-v7a`. Based on your system, you might want to enforce a specific generator to prevent issues, e.g. using `MinGW Makefiles`.
8e6f647
to
806813e
Compare
These changes added an ANDROID_ABI option (https://github.com/SFML/SFML/pull/1350/files#diff-af3b638bc2a3e6c650974192a53c7291R133), but is it still used anywhere? |
Oh, no, that's obviously some leftover – not 100% sure how it ended in there. The correct variable is |
Running ndk-build in the examples/android folder now gives the following error for me:
It works when I change the last line to It seems like it only looks inside the /ndk-path/sources directory for sfml and not in /ndk-path/sources/third_party folder. |
Yeah, now I've noticed what's going on here. @eXpl0it3r merged the PR before I could push the WIP changes including the updated example. Will have to see how I can put this straight on the weekend. |
This PR provides two changes:
The previous custom CMake toolchain file for Android is dropped in favor of CMake's new built-in toolchain for this (CMake >3.7.2).
Includes AlexAUT's fixes for the latest NDK releases from PR Android build support for newest NDK release #1287.
This makes building SFML for Android a lot simpler and more straight forward, working almost as smooth as other platforms.
To configure your build directory, all you have to do is defining just a few variables the first time you invoke CMake.
Required Variables
CMAKE_SYSTEM_NAME
must beAndroid
, so CMake knows we actually want to cross-compile.CMAKE_ANDROID_NDK
must point to the NDK's installation directory, e.g./usr/android/ndk
orc:/android/ndk
.Recommended Variables
CMAKE_ANDROID_STL_TYPE
defines the STL implementation to be used. You should usec++_shared
, although others might work.Optional Variables
CMAKE_SYSTEM_VERSION
can be set to pick a specific SDK version other than the latest.CMAKE_ANDROID_ARCH_ABI
defines the target architecture and ABI, for examplearmeabi
orarmeabi-v7a
.Based on your system, you might want to enforce a specific generator to prevent issues, e.g. using
MinGW Makefiles
.