diff options
author | Brad King <brad.king@kitware.com> | 2016-08-23 17:08:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-23 17:10:51 (GMT) |
commit | 7b637ebdc97655462d08d8ff70bee5d4f32e4681 (patch) | |
tree | 037638b87540fc203610652d2d96c700b0fa306c /Tests/RunCMake | |
parent | c2f561e58c799cc82df7db70710ae2f79b8b6b64 (diff) | |
download | CMake-7b637ebdc97655462d08d8ff70bee5d4f32e4681.zip CMake-7b637ebdc97655462d08d8ff70bee5d4f32e4681.tar.gz CMake-7b637ebdc97655462d08d8ff70bee5d4f32e4681.tar.bz2 |
Android: Add `ANDROID` variable to indicate the target
Allow projects to use `if(ANDROID)` to condition their Android-specific
code paths.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/Android/common.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake index a679f6c..7eac5d6 100644 --- a/Tests/RunCMake/Android/common.cmake +++ b/Tests/RunCMake/Android/common.cmake @@ -1,6 +1,10 @@ enable_language(C) enable_language(CXX) +if(NOT ANDROID) + message(SEND_ERROR "CMake variable 'ANDROID' is not set to a true value.") +endif() + foreach(f "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}" "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}g++${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}" |