diff options
author | Brad King <brad.king@kitware.com> | 2017-08-04 13:10:04 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-08-04 13:11:43 (GMT) |
commit | 15f16025843fd5ed222c78a66f5b00f0533d0a3b (patch) | |
tree | 0e0a7d55f7f7bc53a444886fbda7d3473cdea79a /Modules/Platform | |
parent | d4c2a58d1337cd383a8be6a5813f0ecd83548f2c (diff) | |
parent | 68d67c827fceabc22bb0be76f084391659dc9a28 (diff) | |
download | CMake-15f16025843fd5ed222c78a66f5b00f0533d0a3b.zip CMake-15f16025843fd5ed222c78a66f5b00f0533d0a3b.tar.gz CMake-15f16025843fd5ed222c78a66f5b00f0533d0a3b.tar.bz2 |
Merge topic 'android-plain-sysroot'
68d67c82 Android: Fix support for CMAKE_SYSROOT without CMAKE_SYSROOT_COMPILE
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1101
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Android-Common.cmake | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake index 5faada3..80a8f41 100644 --- a/Modules/Platform/Android-Common.cmake +++ b/Modules/Platform/Android-Common.cmake @@ -160,13 +160,19 @@ macro(__android_compiler_common lang) # Do not do this for a standalone toolchain because it is already # tied to a specific API version. if(CMAKE_ANDROID_NDK) + if(CMAKE_SYSROOT_COMPILE) + set(_cmake_sysroot_compile "${CMAKE_SYSROOT_COMPILE}") + else() + set(_cmake_sysroot_compile "${CMAKE_SYSROOT}") + endif() if(NOT CMAKE_ANDROID_NDK_DEPRECATED_HEADERS) list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES - "${CMAKE_SYSROOT_COMPILE}/usr/include" - "${CMAKE_SYSROOT_COMPILE}/usr/include/${CMAKE_ANDROID_ARCH_HEADER_TRIPLE}" + "${_cmake_sysroot_compile}/usr/include" + "${_cmake_sysroot_compile}/usr/include/${CMAKE_ANDROID_ARCH_HEADER_TRIPLE}" ) else() - list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_SYSROOT}/usr/include") + list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${_cmake_sysroot_compile}/usr/include") endif() + unset(_cmake_sysroot_compile) endif() endmacro() |