From 2cae5128fdc6316a7f0913cb89ec467b33b9715b Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Sun, 7 Feb 2016 20:20:02 +0100 Subject: [PATCH 1/2] Apple: Enable -isystem for GNU Compiler >= 4 (#15953) Due to #4662 -isystem support was disabled for all GNU Compilers on Apple platforms. But the change was probably a just work around for a broken compiler on Tiger (see 10837#c27206). So we tighten the condition to only kick in for GCC versions earlier than 4. That should ensure sane behavior for Xcode 3.2 and later. --- Modules/Compiler/GNU.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 764fbf990..d1ca85e3d 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -52,7 +52,7 @@ macro(__compiler_gnu lang) set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE " -E > ") set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE " -S -o ") - if(NOT APPLE) + if(NOT APPLE OR NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4) # work around #4462 set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") endif() endmacro() From 5b04aa31b8d791bc5e162fbc8c89b2d0058c8572 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Mon, 8 Feb 2016 12:48:35 +0100 Subject: [PATCH 2/2] Xcode: Disable test for system include dirs --- Tests/Complex/Executable/CMakeLists.txt | 3 ++- Tests/ComplexOneConfig/Executable/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index a1f8e68a7..c30dcbc40 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -146,7 +146,8 @@ add_dependencies(notInAllCustom notInAllExe) # add_subdirectory(Temp) -if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX + AND NOT XCODE) # XCODE is excluded due to #15687 add_executable(testSystemDir testSystemDir.cxx) set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") endif() diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index b2307b21f..4897b484a 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -146,7 +146,8 @@ add_dependencies(notInAllCustom notInAllExe) # add_subdirectory(Temp) -if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX + AND NOT XCODE) # XCODE is excluded due to #15687 add_executable(testSystemDir testSystemDir.cxx) set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") endif()