aboutsummaryrefslogtreecommitdiff
path: root/cmake/compiler/clang
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/compiler/clang')
-rw-r--r--cmake/compiler/clang/settings.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake
index 1fe89542a84..2b6e998d854 100644
--- a/cmake/compiler/clang/settings.cmake
+++ b/cmake/compiler/clang/settings.cmake
@@ -150,3 +150,13 @@ if(BUILD_SHARED_LIBS)
message(STATUS "Clang: Disallow undefined symbols")
endif()
+
+# speedup PCH builds by forcing template instantiations during PCH generation
+set(CMAKE_REQUIRED_FLAGS "-fpch-instantiate-templates")
+check_cxx_source_compiles("int main() { return 0; }" CLANG_HAS_PCH_INSTANTIATE_TEMPLATES)
+unset(CMAKE_REQUIRED_FLAGS)
+if(CLANG_HAS_PCH_INSTANTIATE_TEMPLATES)
+ target_compile_options(trinity-compile-option-interface
+ INTERFACE
+ -fpch-instantiate-templates)
+endif()