[cmake-developers] 3.9.0-rc3: CMAKE_ANDROID_NDK_DEPRECATED_HEADERS doesn't work outside of toolchain
Brad King
brad.king at kitware.com
Mon Jun 26 16:32:50 EDT 2017
On 06/26/2017 11:58 AM, Robert Dailey wrote:
> Why does this only work in the toolchain file?
1. It needs to be set early.
2. It needs to propagate into try_compile projects.
The toolchain file is sufficient for both. A cache entry is okay
for (1) but for (2) one would additionally need to set this:
https://cmake.org/cmake/help/v3.9/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.html
...though that is really meant for toolchain files too.
Note that toolchain files are meant to be local to the machine, not
distributed with source trees and full of introspection logic. The
(local) author of the toolchain file should know the NDK version and
choose whether to use `CMAKE_ANDROID_NDK_DEPRECATED_HEADERS`.
Your project code could check the NDK version and error out if
the `CMAKE_ANDROID_NDK_DEPRECATED_HEADERS` is not correct.
-Brad
More information about the cmake-developers
mailing list