diff options
author | Albert Astals Cid <aacid@kde.org> | 2022-03-08 16:52:57 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2022-03-08 16:54:53 +0100 |
commit | c958fdbc1b64b4591e434e5b6ae702e36b87af5c (patch) | |
tree | 1adbc03acb31acc2a203f9f66ecc1add79ac48c1 | |
parent | 935c2abff7bf531a9758bf2fbdc6b0d8abe636e8 (diff) | |
download | extra-cmake-modules-c958fdbc1b64b4591e434e5b6ae702e36b87af5c.tar.gz extra-cmake-modules-c958fdbc1b64b4591e434e5b6ae702e36b87af5c.tar.bz2 |
Android: Set CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
These are the variables that cmake will pass onto itself when doing a
try_compile, we need that because otherwise when trying to find iconv it
will issue a try compile, won't pass CMAKE_ANDROID_API so it will
default to 21 (instead eg the 28 we had given it) and the try_compile
will fail because android libc only has iconv after API 28
-rw-r--r-- | toolchain/Android.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake index 280f129d..e4c739b0 100644 --- a/toolchain/Android.cmake +++ b/toolchain/Android.cmake @@ -196,6 +196,17 @@ set(ANDROID_PLATFORM "android-${CMAKE_ANDROID_API}") set(ANDROID_STL ${CMAKE_ANDROID_STL_TYPE}) include(${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake REQUIRED) +# Export configurable variables for the try_compile() command. +list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES + CMAKE_ANDROID_NDK + CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION + CMAKE_ANDROID_API + CMAKE_ANDROID_ARCH + CMAKE_ANDROID_ARCH_ABI + ANDROID_SDK_ROOT + ANDROID_SDK_COMPILE_API +) + ## HACK: Remove when we can depend on NDK r23 # Workaround issue https://github.com/android/ndk/issues/929 if(ANDROID_NDK_MAJOR VERSION_LESS 23) |