summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-09 15:23:26 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-09 15:23:34 (GMT)
commit802584f0c26ffbf4b311c176d37a6e4fee70eb7c (patch)
tree56edc8776ed78d5619fb68096614730aaeb98dab /Modules/Compiler/Clang.cmake
parent0834b8b8cb616607d8425a5252e64dcc6592a5e1 (diff)
parent8d61294c3e127ceb6284fccb9cdc60287889fd1f (diff)
downloadCMake-802584f0c26ffbf4b311c176d37a6e4fee70eb7c.zip
CMake-802584f0c26ffbf4b311c176d37a6e4fee70eb7c.tar.gz
CMake-802584f0c26ffbf4b311c176d37a6e4fee70eb7c.tar.bz2
Merge topic 'ios-pch-x-lang-header' into release-3.18
8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5188
Diffstat (limited to 'Modules/Compiler/Clang.cmake')
-rw-r--r--Modules/Compiler/Clang.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index 52d5350..f7858d7 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -10,6 +10,11 @@ set(__COMPILER_CLANG 1)
include(Compiler/CMakeCommonCompilerMacros)
+set(__pch_header_C "c-header")
+set(__pch_header_CXX "c++-header")
+set(__pch_header_OBJC "objective-c-header")
+set(__pch_header_OBJCXX "objective-c++-header")
+
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
@@ -102,7 +107,7 @@ else()
set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
endif()
set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>)
- set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER> -x ${__pch_header_${lang}})
endmacro()
endif()