diff options
author | Brad King <brad.king@kitware.com> | 2017-06-09 20:28:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-06-09 20:28:32 (GMT) |
commit | 22f8a465d7de84b246f6d5ec0e05984b5610122f (patch) | |
tree | df8274abd244dbac60416ecab0726a1e1c44451d /Modules/Platform | |
parent | d025faf436c86ee9cc033fbb324a9bc2c18757fa (diff) | |
download | CMake-22f8a465d7de84b246f6d5ec0e05984b5610122f.zip CMake-22f8a465d7de84b246f6d5ec0e05984b5610122f.tar.gz CMake-22f8a465d7de84b246f6d5ec0e05984b5610122f.tar.bz2 |
Android: Do not pass sysroot include for standalone toolchain
The change in commit v3.8.0-rc1~60^2 (Android: Pass sysroot include
directory explicitly, 2017-01-20) does not make sense when compiling
with a standalone toolchain which is tied to a single API version.
Drop the explicit include directory so that the compiler uses its
default system include order.
Fixes: #16954
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Android-Common.cmake | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake index cf2785a..78938dc 100644 --- a/Modules/Platform/Android-Common.cmake +++ b/Modules/Platform/Android-Common.cmake @@ -156,6 +156,11 @@ macro(__android_compiler_common lang) # necessary so that Android API-version-specific headers are preferred # over those in the toolchain's `include-fixed` directory (which cannot # possibly match all versions). - list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_SYSROOT}/usr/include") - list(REMOVE_ITEM CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include") + # + # Do not do this for a standalone toolchain because it is already + # tied to a specific API version. + if(CMAKE_ANDROID_NDK) + list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_SYSROOT}/usr/include") + list(REMOVE_ITEM CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include") + endif() endmacro() |