summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories/CMakeLists.txt
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2015-08-31 20:33:37 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2016-08-09 18:30:07 (GMT)
commit93ac2a78d5e0dbb6607105cc8d2a3f19ebdd8583 (patch)
tree0534a5c5a6241ca5dc5f75338ab3d1fc3028cd7d /Tests/IncludeDirectories/CMakeLists.txt
parent4689d16e8aa90e57a8456357251b6575131529d7 (diff)
downloadCMake-93ac2a78d5e0dbb6607105cc8d2a3f19ebdd8583.zip
CMake-93ac2a78d5e0dbb6607105cc8d2a3f19ebdd8583.tar.gz
CMake-93ac2a78d5e0dbb6607105cc8d2a3f19ebdd8583.tar.bz2
Xcode: Obey SYSTEM keyword for includes (#15687)
CMake used to put all header search paths into HEADER_SEARCH_PATHS attribute. Unfortunately this attribute does not support to declare a search path as a system include. As a hack one could add a -isystem /path to the cflags but then include ordering is not deterministic. A better approach was chosen with this patch by not filling HEADER_SEARCH_PATHS at all and to populate the C, C++, and Fortran flags directly. The include paths used by Xcode should be now identical to the ones used by Unix Makefiles and Ninja generator.
Diffstat (limited to 'Tests/IncludeDirectories/CMakeLists.txt')
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt4
1 files changed, 3 insertions, 1 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)