summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android-Common.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-12 14:57:00 (GMT)
committerBrad King <brad.king@kitware.com>2017-06-12 15:47:30 (GMT)
commit3d00be13ee04a48be1a6d0d64057494839e1df6f (patch)
tree415b7bcfcf2bc0d4df1dcd2766a378c008b61884 /Modules/Platform/Android-Common.cmake
parenta131316a95fde7ae19ec851369d9a186e6488d0c (diff)
downloadCMake-3d00be13ee04a48be1a6d0d64057494839e1df6f.zip
CMake-3d00be13ee04a48be1a6d0d64057494839e1df6f.tar.gz
CMake-3d00be13ee04a48be1a6d0d64057494839e1df6f.tar.bz2
Android: Add support for unified headers
The unified headers are preferred as of NDK r15, so use them by default if available and provide an option to use the deprecated headers. Inspired-by: Florent Castelli <florent.castelli@gmail.com> Fixes: #16584
Diffstat (limited to 'Modules/Platform/Android-Common.cmake')
-rw-r--r--Modules/Platform/Android-Common.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake
index 78938dc..ac72676 100644
--- a/Modules/Platform/Android-Common.cmake
+++ b/Modules/Platform/Android-Common.cmake
@@ -161,6 +161,9 @@ macro(__android_compiler_common lang)
# tied to a specific API version.
if(CMAKE_ANDROID_NDK)
list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_SYSROOT}/usr/include")
+ if(NOT CMAKE_ANDROID_NDK_DEPRECATED_HEADERS)
+ list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_SYSROOT}/usr/include/${CMAKE_ANDROID_ARCH_HEADER_TRIPLE}")
+ endif()
list(REMOVE_ITEM CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include")
endif()
endmacro()