diff options
author | Brad King <brad.king@kitware.com> | 2020-05-12 10:52:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-12 10:52:40 (GMT) |
commit | cd89ebdda2bc071036f1e106522a955625c42154 (patch) | |
tree | bb079a39c7a1f168e0219bf0b3ec76e2bf3885c2 /Modules/Platform | |
parent | 04a29efe99af409e53b01f7ab08ea210102eb2a5 (diff) | |
parent | 6c2514dabec63929b2994b2ddd2b83cb5efa357e (diff) | |
download | CMake-cd89ebdda2bc071036f1e106522a955625c42154.zip CMake-cd89ebdda2bc071036f1e106522a955625c42154.tar.gz CMake-cd89ebdda2bc071036f1e106522a955625c42154.tar.bz2 |
Merge topic 'pch-msvc-pragma'
6c2514dabe MSVC: Use 'pragma system_header' in PCH only on cl 19.13 and above
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4736
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 7ee501b..2476a33 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) |