summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-04 14:12:51 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-10-04 14:13:00 (GMT)
commitf9e2c17458d5d9998b8b87a953b50a4837fe80e9 (patch)
tree52e44eff44074a2173de2cb242b627db55b2dc6f
parent65020633e62eaf0d86f85bcf1240caacd2095de9 (diff)
parentbc4f8f4472ae94b7053ee373a7406774900f350c (diff)
downloadCMake-f9e2c17458d5d9998b8b87a953b50a4837fe80e9.zip
CMake-f9e2c17458d5d9998b8b87a953b50a4837fe80e9.tar.gz
CMake-f9e2c17458d5d9998b8b87a953b50a4837fe80e9.tar.bz2
Merge topic 'pch-clang-pch-regen'
bc4f8f4472 PCH: Use clang's own pch functionality instead of the GCC emulation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3881
-rw-r--r--Modules/Compiler/Clang.cmake3
-rw-r--r--Modules/Platform/Windows-Clang.cmake7
2 files changed, 7 insertions, 3 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index 45c33fb..ea5a3b3 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -97,6 +97,9 @@ else()
"\"${__ranlib}\" <TARGET>"
)
+ set(CMAKE_PCH_EXTENSION .pch)
set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
+ 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()
endif()
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 84b3a9b..f226553 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -83,9 +83,10 @@ macro(__windows_compiler_clang_gnu lang)
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG -Xclang -gcodeview ${__ADDED_FLAGS}")
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
- set(CMAKE_PCH_EXTENSION .gch)
- 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>)
+ set(CMAKE_PCH_EXTENSION .pch)
+ set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
+ 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>)
unset(__ADDED_FLAGS)
unset(__ADDED_FLAGS_DEBUG)