summaryrefslogtreecommitdiff
path: root/Modules/Platform/Android-Determine.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-06 13:56:21 -0400
committerBrad King <brad.king@kitware.com>2016-08-12 10:40:54 -0400
commitfa6325782112063b5d425714a37c8ebd01b90d7c (patch)
treeb18d5d78cd889a6489589a03087d70a34b82095e /Modules/Platform/Android-Determine.cmake
parent6299693f8aa5f5a61cec82215b73a2040a8d8603 (diff)
downloadcmake-fa6325782112063b5d425714a37c8ebd01b90d7c.tar.gz
Android: Avoid interfering with common pre-existing toolchain files
Commonly used Android toolchain files that pre-date CMake upstream support may need to be updated to work with our new functionality. They typically set CMAKE_SYSTEM_VERSION to 1, so detect that and skip our upstream Android settings. When such toolchain files are updated to account for our upstream support, they can then set CMAKE_SYSTEM_VERSION to a valid Android API and get new behavior.
Diffstat (limited to 'Modules/Platform/Android-Determine.cmake')
-rw-r--r--Modules/Platform/Android-Determine.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index d2d5aaa453..0a89c58c37 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -22,6 +22,12 @@ if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
return()
endif()
+# Commonly used Android toolchain files that pre-date CMake upstream support
+# set CMAKE_SYSTEM_VERSION to 1. Avoid interfering with them.
+if(CMAKE_SYSTEM_VERSION EQUAL 1)
+ return()
+endif()
+
# If the user provided CMAKE_SYSROOT for us, extract information from it.
set(_ANDROID_SYSROOT_NDK "")
set(_ANDROID_SYSROOT_API "")