summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-18 15:33:23 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-09-18 15:34:00 (GMT)
commita981a9a7451bbabdc5048f982dce4b3553fe9711 (patch)
treecd3c938472eae616a801b9c260614e09c8bce6c3 /Modules
parent45b7d5284e11cb34885b756bee8dedeb94fc16cb (diff)
parent729d997f1073c7a177da5b46b073a08b95adfa74 (diff)
downloadCMake-a981a9a7451bbabdc5048f982dce4b3553fe9711.zip
CMake-a981a9a7451bbabdc5048f982dce4b3553fe9711.tar.gz
CMake-a981a9a7451bbabdc5048f982dce4b3553fe9711.tar.bz2
Merge topic 'shared-pch'
729d997f10 Precompile Headers: Add REUSE_FROM signature Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Rickard Englund <rickard@r-englund.com> Acked-by: Viktor Kirilov <vik.kirilov@gmail.com> Merge-request: !3762
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Windows-MSVC.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 6ddcaa3..34f5d03 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -333,10 +333,17 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_LINK_PCH ON)
if(MSVC_VERSION GREATER_EQUAL 1910)
# VS 2017 or greater
- set(CMAKE_PCH_PROLOGUE "#pragma system_header")
+ if (NOT ${CMAKE_${lang}_COMPILER_ID} STREQUAL "Clang")
+ set(CMAKE_PCH_PROLOGUE "#pragma system_header")
+ else()
+ set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
+ endif()
+ endif()
+ if (NOT ${CMAKE_${lang}_COMPILER_ID} STREQUAL "Clang")
+ set(CMAKE_PCH_COPY_COMPILE_PDB ON)
endif()
- set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH /Yu<PCH_HEADER> /FI<PCH_HEADER>)
- set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH /Yc<PCH_HEADER> /FI<PCH_HEADER>)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH /Yu<PCH_HEADER> /Fp<PCH_FILE> /FI<PCH_HEADER>)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH /Yc<PCH_HEADER> /Fp<PCH_FILE> /FI<PCH_HEADER>)
if("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC")
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)