diff options
author | Brad King <brad.king@kitware.com> | 2017-07-13 14:07:32 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-07-13 14:07:36 (GMT) |
commit | 489a7706c25b604fa06644ab5044a9f5954b7953 (patch) | |
tree | f4556312acf0ce7a108240655945244e1323a225 /Tests | |
parent | aa97170f2b25a99d2cc69fd6b2a059e52872f341 (diff) | |
parent | 4bafa3922e3773e5bcc6741994379455c7d1c0fc (diff) | |
download | CMake-489a7706c25b604fa06644ab5044a9f5954b7953.zip CMake-489a7706c25b604fa06644ab5044a9f5954b7953.tar.gz CMake-489a7706c25b604fa06644ab5044a9f5954b7953.tar.bz2 |
Merge topic 'android-system-include-last'
4bafa392 Android: Always add standard include directories last
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1052
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/Android/android_sysinc.c | 7 | ||||
-rw-r--r-- | Tests/RunCMake/Android/android_sysinc.cxx | 7 | ||||
-rw-r--r-- | Tests/RunCMake/Android/common.cmake | 16 | ||||
-rw-r--r-- | Tests/RunCMake/Android/sysinc/dlfcn.h | 1 |
4 files changed, 31 insertions, 0 deletions
diff --git a/Tests/RunCMake/Android/android_sysinc.c b/Tests/RunCMake/Android/android_sysinc.c new file mode 100644 index 0000000..18d73db --- /dev/null +++ b/Tests/RunCMake/Android/android_sysinc.c @@ -0,0 +1,7 @@ +#include <dlfcn.h> + +#ifndef NOT_SYSTEM_DLFCN_HEADER +#error "sysroot /usr/include appears too early" +#endif + +#include "android.c" diff --git a/Tests/RunCMake/Android/android_sysinc.cxx b/Tests/RunCMake/Android/android_sysinc.cxx new file mode 100644 index 0000000..5c5694b --- /dev/null +++ b/Tests/RunCMake/Android/android_sysinc.cxx @@ -0,0 +1,7 @@ +#include <dlfcn.h> + +#ifndef NOT_SYSTEM_DLFCN_HEADER +#error "sysroot /usr/include appears too early" +#endif + +#include "android.cxx" diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake index bef2428..015f202 100644 --- a/Tests/RunCMake/Android/common.cmake +++ b/Tests/RunCMake/Android/common.cmake @@ -92,3 +92,19 @@ if(CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a") endif() add_executable(android_c android.c) add_executable(android_cxx android.cxx) + +# Test that an explicit /usr/include is ignored in favor of +# appearing as a standard include directory at the end. +set(sysinc_dirs) +if(CMAKE_ANDROID_NDK) + if(NOT CMAKE_ANDROID_NDK_DEPRECATED_HEADERS) + list(APPEND sysinc_dirs ${CMAKE_SYSROOT_COMPILE}/usr/include) + else() + list(APPEND sysinc_dirs ${CMAKE_SYSROOT}/usr/include) + endif() +endif() +list(APPEND sysinc_dirs ${CMAKE_CURRENT_SOURCE_DIR}/sysinc) +add_executable(android_sysinc_c android_sysinc.c) +target_include_directories(android_sysinc_c SYSTEM PRIVATE ${sysinc_dirs}) +add_executable(android_sysinc_cxx android_sysinc.cxx) +target_include_directories(android_sysinc_cxx SYSTEM PRIVATE ${sysinc_dirs}) diff --git a/Tests/RunCMake/Android/sysinc/dlfcn.h b/Tests/RunCMake/Android/sysinc/dlfcn.h new file mode 100644 index 0000000..273306c --- /dev/null +++ b/Tests/RunCMake/Android/sysinc/dlfcn.h @@ -0,0 +1 @@ +#define NOT_SYSTEM_DLFCN_HEADER |