diff options
author | Brad King <brad.king@kitware.com> | 2019-12-05 16:39:15 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-12-05 16:39:24 (GMT) |
commit | a795aa145ca22a596dd8e4a20dea3eca19b3c523 (patch) | |
tree | 3c545130a3c6de82c17ebb630d221eaed7c04527 /Modules | |
parent | 8ee4f372aad33eba556c2ec116498ea949dcf03c (diff) | |
parent | df8372da0926a0a6fd995e50fc378bd699ea54dd (diff) | |
download | CMake-a795aa145ca22a596dd8e4a20dea3eca19b3c523.zip CMake-a795aa145ca22a596dd8e4a20dea3eca19b3c523.tar.gz CMake-a795aa145ca22a596dd8e4a20dea3eca19b3c523.tar.bz2 |
Merge topic 'pch-xcode-no-warning'
df8372da09 PCH: Do not add #pragma system_header for Xcode generator
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4098
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/Clang.cmake | 4 | ||||
-rw-r--r-- | Modules/Compiler/GNU.cmake | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index ea5a3b3..5cc9328 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -98,7 +98,9 @@ else() ) set(CMAKE_PCH_EXTENSION .pch) - set(CMAKE_PCH_PROLOGUE "#pragma clang system_header") + if (NOT CMAKE_GENERATOR MATCHES "Xcode") + set(CMAKE_PCH_PROLOGUE "#pragma clang system_header") + endif() set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE>) set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>) endmacro() 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() |