Skip to content
Snippets Groups Projects
Commit 7b637ebd authored by Brad King's avatar Brad King
Browse files

Android: Add `ANDROID` variable to indicate the target

Allow projects to use `if(ANDROID)` to condition their Android-specific
code paths.
parent c2f561e5
No related branches found
No related tags found
No related merge requests found
......@@ -173,6 +173,7 @@ Variables that Describe the System
.. toctree::
:maxdepth: 1
/variable/ANDROID
/variable/APPLE
/variable/BORLAND
/variable/CMAKE_CL_64
......
ANDROID
-------
Set to ``1`` when the target system (:variable:`CMAKE_SYSTEM_NAME`) is
``Android``.
include(Platform/Linux)
set(ANDROID 1)
# Android has soname, but binary names must end in ".so" so we cannot append
# a version number. Also we cannot portably represent symlinks on the host.
set(CMAKE_PLATFORM_NO_VERSIONED_SONAME 1)
......
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}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment