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

Robert Dailey rcdailey.lists at gmail.com
Tue Jun 27 11:14:43 EDT 2017


On Mon, Jun 26, 2017 at 3:32 PM, Brad King <brad.king at kitware.com> wrote:
> 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.

Your idea of erroring out seems like the best alternative solution,
although again I strongly feel this is something that should be
automated. It makes the user's life easier. If we know it only works a
certain way and have the necessary information to make that decision
programmatically, then why not? Software is supposed to make our lives
easier. Adding unnecessary manual steps doesn't really serve any
benefit IMHO.

Also at $DAYJOB, we all work on the same code base. Our product is
tested and verified to work on a distinct set of configurations. Why
would I ask each user to create their own toolchain file? Each time a
change is needed, I'd have to email the whole team and ask them to
make a specific change to their toolchain file. This is very
unproductive. I can't say I agree with your philosophy.


More information about the cmake-developers mailing list