summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/GNU.cmake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-11-29 16:59:52 (GMT)
committerBrad King <brad.king@kitware.com>2019-12-04 17:56:53 (GMT)
commitdf8372da0926a0a6fd995e50fc378bd699ea54dd (patch)
treeae8f83138cee0fe8f3f6bbf6cfdc704f769de70a /Modules/Compiler/GNU.cmake
parent1b4482f65dd41f21ec8abc0777b8dc1f0381bbd6 (diff)
downloadCMake-df8372da0926a0a6fd995e50fc378bd699ea54dd.zip
CMake-df8372da0926a0a6fd995e50fc378bd699ea54dd.tar.gz
CMake-df8372da0926a0a6fd995e50fc378bd699ea54dd.tar.bz2
PCH: Do not add #pragma system_header for Xcode generator
Fixes: #20039
Diffstat (limited to 'Modules/Compiler/GNU.cmake')
-rw-r--r--Modules/Compiler/GNU.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 6960571..1c050a2 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -111,7 +111,9 @@ macro(__compiler_gnu lang)
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
set(CMAKE_PCH_EXTENSION .gch)
- set(CMAKE_PCH_PROLOGUE "#pragma GCC system_header")
+ if (NOT CMAKE_GENERATOR MATCHES "Xcode")
+ set(CMAKE_PCH_PROLOGUE "#pragma GCC system_header")
+ endif()
set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Winvalid-pch -include <PCH_HEADER>)
set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Winvalid-pch -x ${__pch_header_${lang}} -include <PCH_HEADER>)
endmacro()