summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang.cmake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-10-03 12:43:00 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2019-10-03 12:43:00 (GMT)
commitbc4f8f4472ae94b7053ee373a7406774900f350c (patch)
treef12601e4150f75d105b7578e4e12eded6b1c4b23 /Modules/Compiler/Clang.cmake
parent53dedbd51e985ca515b7454520b7c5edd2eaf912 (diff)
downloadCMake-bc4f8f4472ae94b7053ee373a7406774900f350c.zip
CMake-bc4f8f4472ae94b7053ee373a7406774900f350c.tar.gz
CMake-bc4f8f4472ae94b7053ee373a7406774900f350c.tar.bz2
PCH: Use clang's own pch functionality instead of the GCC emulation
Fixes: #19786
Diffstat (limited to 'Modules/Compiler/Clang.cmake')
-rw-r--r--Modules/Compiler/Clang.cmake3
1 files changed, 3 insertions, 0 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()