diff options
author | Brad King <brad.king@kitware.com> | 2016-06-06 17:56:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-12 14:40:54 (GMT) |
commit | fa6325782112063b5d425714a37c8ebd01b90d7c (patch) | |
tree | b18d5d78cd889a6489589a03087d70a34b82095e /Modules/Platform/Android-Initialize.cmake | |
parent | 6299693f8aa5f5a61cec82215b73a2040a8d8603 (diff) | |
download | CMake-fa6325782112063b5d425714a37c8ebd01b90d7c.zip CMake-fa6325782112063b5d425714a37c8ebd01b90d7c.tar.gz CMake-fa6325782112063b5d425714a37c8ebd01b90d7c.tar.bz2 |
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-Initialize.cmake')
-rw-r--r-- | Modules/Platform/Android-Initialize.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake index 625490e..c0354c7 100644 --- a/Modules/Platform/Android-Initialize.cmake +++ b/Modules/Platform/Android-Initialize.cmake @@ -21,6 +21,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(NOT CMAKE_SYSROOT) if(CMAKE_ANDROID_NDK) set(CMAKE_SYSROOT "${CMAKE_ANDROID_NDK}/platforms/android-${CMAKE_SYSTEM_VERSION}/arch-${CMAKE_ANDROID_ARCH}") |