summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-MSVC.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-11 17:34:25 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-11 17:34:25 (GMT)
commit4b810405a4ad49e24f2d5531a6ad223101425f22 (patch)
treec35dc7df8afefcb40e8f03090457dfe7bc78dda4 /Modules/Platform/Windows-MSVC.cmake
parent9cd0523a33d22cee8af79d44d54cffdabe526bbc (diff)
parent6c2514dabec63929b2994b2ddd2b83cb5efa357e (diff)
downloadCMake-4b810405a4ad49e24f2d5531a6ad223101425f22.zip
CMake-4b810405a4ad49e24f2d5531a6ad223101425f22.tar.gz
CMake-4b810405a4ad49e24f2d5531a6ad223101425f22.tar.bz2
Merge branch 'pch-msvc-pragma' into release-3.16
Merge-request: !4736
Diffstat (limited to 'Modules/Platform/Windows-MSVC.cmake')
-rw-r--r--Modules/Platform/Windows-MSVC.cmake12
1 files changed, 5 insertions, 7 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 34f5d03..e0f33bd 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -331,13 +331,11 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_PCH_EXTENSION .pch)
set(CMAKE_LINK_PCH ON)
- if(MSVC_VERSION GREATER_EQUAL 1910)
- # VS 2017 or greater
- 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()
+ if (CMAKE_${lang}_COMPILER_ID STREQUAL "Clang")
+ set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
+ elseif(MSVC_VERSION GREATER_EQUAL 1913)
+ # At least MSVC toolet 14.13 from VS 2017 15.6
+ set(CMAKE_PCH_PROLOGUE "#pragma system_header")
endif()
if (NOT ${CMAKE_${lang}_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_PCH_COPY_COMPILE_PDB ON)