summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Android
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-14 19:19:55 (GMT)
committerBrad King <brad.king@kitware.com>2016-11-14 19:39:50 (GMT)
commitf7c5e970a0b9697ecdb443aecdee87b51e0a5457 (patch)
treed61ded7677eee1877aa6d80c7fb4cb429e1d81c8 /Tests/RunCMake/Android
parentd95e6dff3cb869d45b27836dc0967ab27872bcdc (diff)
downloadCMake-f7c5e970a0b9697ecdb443aecdee87b51e0a5457.zip
CMake-f7c5e970a0b9697ecdb443aecdee87b51e0a5457.tar.gz
CMake-f7c5e970a0b9697ecdb443aecdee87b51e0a5457.tar.bz2
Android: Add CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE
Expose the binutils' machine name (typically used as a prefix on the tool names) publicly. This is expected to match the `gcc -dumpmachine` value. Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
Diffstat (limited to 'Tests/RunCMake/Android')
-rw-r--r--Tests/RunCMake/Android/common.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake
index 0afa78c..bef2428 100644
--- a/Tests/RunCMake/Android/common.cmake
+++ b/Tests/RunCMake/Android/common.cmake
@@ -52,6 +52,23 @@ elseif(CMAKE_ANDROID_STANDALONE_TOOLCHAIN)
endif()
endif()
+execute_process(
+ COMMAND "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}" -dumpmachine
+ OUTPUT_VARIABLE _out OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _err
+ RESULT_VARIABLE _res
+ )
+if(NOT _res EQUAL 0)
+ message(SEND_ERROR "Failed to run 'gcc -dumpmachine':\n ${_res}")
+endif()
+if(NOT _out STREQUAL "${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}")
+ message(SEND_ERROR "'gcc -dumpmachine' produced:\n"
+ " ${_out}\n"
+ "which is not equal to CMAKE_C_ANDROID_TOOLCHAIN_MACHINE:\n"
+ " ${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}"
+ )
+endif()
+
if(CMAKE_ANDROID_STL_TYPE STREQUAL "none")
add_definitions(-DSTL_NONE)
elseif(CMAKE_ANDROID_STL_TYPE STREQUAL "system")