Commit 4b810405 authored by Brad King's avatar Brad King
Browse files

Merge branch 'pch-msvc-pragma' into release-3.16

Merge-request: !4736
parents 9cd0523a 6c2514da
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment