diff options
author | Brad King <brad.king@kitware.com> | 2016-11-11 20:22:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-18 15:03:07 (GMT) |
commit | 0d3eb139e117582fe5a625c1c380bb30dbc6d31b (patch) | |
tree | 25c228bc376ebc68a6990645079bbcf6b521aefd /Tests | |
parent | 236d6244a0f44fbe0f50f16fb259a3817ce463c4 (diff) | |
download | CMake-0d3eb139e117582fe5a625c1c380bb30dbc6d31b.zip CMake-0d3eb139e117582fe5a625c1c380bb30dbc6d31b.tar.gz CMake-0d3eb139e117582fe5a625c1c380bb30dbc6d31b.tar.bz2 |
Android: Add CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG variable
The NDK provides prebuilt toolchain files in directories named for the
host architecture. The NDK build system calls this `HOST_TAG`.
Expose the value publicly for use by clients that need to pass it
to external tools.
Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/Android/common.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake index 18c9797..0afa78c 100644 --- a/Tests/RunCMake/Android/common.cmake +++ b/Tests/RunCMake/Android/common.cmake @@ -32,6 +32,14 @@ if(CMAKE_ANDROID_NDK) "which does not appear in CMAKE_C_COMPILER:\n" " ${CMAKE_C_COMPILER}") endif() + if(NOT CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG) + message(SEND_ERROR "CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG is not set!") + elseif(NOT "${CMAKE_C_COMPILER}" MATCHES "prebuilt/${CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG}/bin") + message(SEND_ERROR "CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG is\n" + " ${CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG}\n" + "which does not appear in CMAKE_C_COMPILER:\n" + " ${CMAKE_C_COMPILER}") + endif() elseif(CMAKE_ANDROID_STANDALONE_TOOLCHAIN) execute_process( COMMAND ${CMAKE_ANDROID_STANDALONE_TOOLCHAIN}/bin/clang --version |