summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-10 20:32:32 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-10 20:32:39 (GMT)
commit48ed3bae5874db9f9a470ae18de42222d7a252b4 (patch)
tree43f3558f8e1a5b11eda4bcbdd17d837f45f3c5c8 /Modules/Compiler/Clang.cmake
parente32f4da74a69b2fa80e33da286f8f06671d0a8b5 (diff)
parent8c8f03422e3197a3414a8ed1413fcb9576df0f4b (diff)
downloadCMake-48ed3bae5874db9f9a470ae18de42222d7a252b4.zip
CMake-48ed3bae5874db9f9a470ae18de42222d7a252b4.tar.gz
CMake-48ed3bae5874db9f9a470ae18de42222d7a252b4.tar.bz2
Merge topic 'pch-instantiate-templates'
8c8f03422e PCH: Template instantiation support Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Raul Tambre <raul@tambre.ee> Acked-by: Cristian Adam <cristian.adam@gmail.com> Tested-by: Raul Tambre <raul@tambre.ee> Merge-request: !5168
Diffstat (limited to 'Modules/Compiler/Clang.cmake')
-rw-r--r--Modules/Compiler/Clang.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index f7858d7..c43265d 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -106,6 +106,9 @@ else()
if (NOT CMAKE_GENERATOR MATCHES "Xcode")
set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
endif()
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0.0 AND NOT __is_apple_clang)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_INSTANTIATE_TEMPLATES_PCH -fpch-instantiate-templates)
+ 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> -x ${__pch_header_${lang}})
endmacro()