-
Notifications
You must be signed in to change notification settings - Fork 254
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
CMake: CMAKE_FIND_ROOT_PATH_MODE variables should not override values #517
Comments
Yeah, that looks right to me. (If you want to upload the change yourself feel free, but it's a bit of a hassle to setup and build the NDK) |
I definitely can't build the NDK. The only testing I can do is to modify the toolchain file in an installed version of the NDK and test it in my own project. I'm not sure if this is sufficient. |
Don't worry about it then. Easy enough for me to make the change on your behalf :) |
Thanks Dan; and sorry for the trouble! |
off-topic, but i'd love to hear your rationale for this. switching folks off the system libz is something we talk about internally (because it's not entirely ABI stable, and that causes very advanced users some trouble), but i'm curious to know if there's any stronger motivation than that. (because obviously this would be likely to upset app developers, so i'm not keen to do it unless i get time machine access to just prevent libz from ever having appeared in the NDK, or there's some stronger motivation.) |
Ultimately our reason is simple: We carry all of our third party dependencies across multiple platforms (Linux OS, Windows OS, stuff outside of android). As such, we need consistent versions of those dependencies across platforms. Furthermore, we need the ability to customize how our libraries are built (shared versus static, etc). The only way I've found that we can guarantee that is by not having dependencies on libraries outside of our control. This is why I need to override the NDK toolchain to stop forcing CMake to search in CMAKE_SYSROOT. An even better example would be OpenSSL. Imagine if you guys packaged that in I understand that not everyone builds their own third party libs, that is an exceptional case for us. However, Android OS doesn't have a package manager in the ubuntu sense, so we cannot control what version of zlib is on the system across multiple OS versions. So we package all dependencies in our APKs and keep things self-sufficient. Hope that helps. |
yeah, thanks. that's basically the case we've already seen (and definitely makes sense). |
This was merged into r16. |
Allow users to override these values in case they want more strict behaviors. For example, they may want to prevent the NDK's libz from being picked up so they can use their own. Test: ./checkbuild.py && ./run_tests.py Bug: android/ndk#517 Change-Id: I5a50f06b6a1a27159cf73b3c011e6f4436ecd020
This matches the behaviour of the Android toolchain cmake file [1] and it allows providing self-compiled libraries (not part of vitasdk/vdpm) as argued in this git issue [2]. [1] https://android.googlesource.com/platform/ndk/+/master/build/cmake/android.toolchain.cmake#281 [2] android/ndk#517
The current android toolchain file does this:
This overwrites values specified at the command line. For example:
The justification for this being specified at the command line has to do with how I manage my third party dependencies. For example, I build zlib myself instead of using the NDK-provided zlib (I also do not load the libz.so provided in
/system/lib
). I literally want none of thefind_*()
functions I perform to find anything in the NDK dir.As such, the toolchain file should respect parameters already set from outside. The below changes fix this for me:
Would this be an acceptable modification of the NDK toolchain file?
The text was updated successfully, but these errors were encountered: