diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2016-12-27 21:18:30 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2016-12-27 21:18:30 (GMT) |
commit | 88f07fb417a25f98662da2abf09a9db03f48eb7f (patch) | |
tree | 85cad64fde40939e8a720aa250512e034205f569 /Tests/IncludeDirectories | |
parent | 65fb0fa63279b96035a144fd2f6413d1b2def47f (diff) | |
download | CMake-88f07fb417a25f98662da2abf09a9db03f48eb7f.zip CMake-88f07fb417a25f98662da2abf09a9db03f48eb7f.tar.gz CMake-88f07fb417a25f98662da2abf09a9db03f48eb7f.tar.bz2 |
Xcode: Properly mark SYSTEM includes as such
We now populate the per-language flags in addition to the header
search paths stored in HEADER_SEARCH_PATHS. This preserves include
paths for GNU assembly files (cmake/cmake#16449) and also provides
SYSTEM include semantics.
Closes: cmake/cmake#15687
Diffstat (limited to 'Tests/IncludeDirectories')
-rw-r--r-- | Tests/IncludeDirectories/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt index 4920582..db18462 100644 --- a/Tests/IncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/CMakeLists.txt @@ -3,7 +3,9 @@ project(IncludeDirectories) if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.4) OR CMAKE_C_COMPILER_ID STREQUAL Clang OR CMAKE_C_COMPILER_ID STREQUAL AppleClang) - AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Ninja")) + AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles" + OR CMAKE_GENERATOR STREQUAL "Ninja" + OR (CMAKE_GENERATOR STREQUAL "Xcode" AND NOT XCODE_VERSION VERSION_LESS 6.0))) include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-Wunused-variable run_sys_includes_test) if(run_sys_includes_test) diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt index dcee85e..5078f30 100644 --- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt @@ -15,10 +15,17 @@ target_include_directories(upstream SYSTEM PUBLIC ) add_library(config_specific INTERFACE) -set(testConfig ${CMAKE_BUILD_TYPE}) -target_include_directories(config_specific SYSTEM INTERFACE - "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>" -) +if(CMAKE_GENERATOR STREQUAL "Xcode") + # CMAKE_BUILD_TYPE does not work here for multi-config generators + target_include_directories(config_specific SYSTEM INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/config_specific" + ) +else() + set(testConfig ${CMAKE_BUILD_TYPE}) + target_include_directories(config_specific SYSTEM INTERFACE + "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>" + ) +endif() add_library(consumer consumer.cpp) target_link_libraries(consumer upstream config_specific) |