summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-11 20:22:43 (GMT)
committerBrad King <brad.king@kitware.com>2016-11-14 19:29:18 (GMT)
commitd95e6dff3cb869d45b27836dc0967ab27872bcdc (patch)
treed6fd427adae7bfb9d83f4759fd38b50774f1aa46 /Tests
parent3d42a72bd5827ea875bbba830ecff90b3aaf54d6 (diff)
downloadCMake-d95e6dff3cb869d45b27836dc0967ab27872bcdc.zip
CMake-d95e6dff3cb869d45b27836dc0967ab27872bcdc.tar.gz
CMake-d95e6dff3cb869d45b27836dc0967ab27872bcdc.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.cmake8
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