diff options
author | Brad King <brad.king@kitware.com> | 2016-11-11 15:22:43 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-14 14:29:18 -0500 |
commit | d95e6dff3cb869d45b27836dc0967ab27872bcdc (patch) | |
tree | d6fd427adae7bfb9d83f4759fd38b50774f1aa46 /Tests/RunCMake/Android | |
parent | 3d42a72bd5827ea875bbba830ecff90b3aaf54d6 (diff) | |
download | cmake-d95e6dff3cb869d45b27836dc0967ab27872bcdc.tar.gz |
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/RunCMake/Android')
-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 18c9797db0..0afa78c635 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 |