[cmake-developers] 3.9.0-rc3: CMAKE_ANDROID_NDK_DEPRECATED_HEADERS doesn't work outside of toolchain

Robert Dailey rcdailey.lists at gmail.com
Mon Jun 26 11:58:38 EDT 2017


Hi,

I tried setting CMAKE_ANDROID_NDK_DEPRECATED_HEADERS in a common CMake
script of mine (set during configuration but before any targets are
created). I also tried making it a cache variable, but in each case it
isn't working. I set like this:

set( CMAKE_ANDROID_NDK_DEPRECATED_HEADERS 1 )

And for r14b NDK, the unified headers were used, I expected them to
NOT be used. When I move the above line of code to my toolchain file,
it works as expected (the unified headers are NOT used).

Why does this only work in the toolchain file? I'd like to be able to
set it outside the toolchain file because I do quite a bit of logic to
determine if I want deprecated headers to be used or not; it's not
meant to be something specified by the user/toolchain in my case, but
rather something calculated.

Thanks in advance.


More information about the cmake-developers mailing list