diff options
author | Brad King <brad.king@kitware.com> | 2020-09-10 20:32:32 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-10 20:32:39 (GMT) |
commit | 48ed3bae5874db9f9a470ae18de42222d7a252b4 (patch) | |
tree | 43f3558f8e1a5b11eda4bcbdd17d837f45f3c5c8 /Source | |
parent | e32f4da74a69b2fa80e33da286f8f06671d0a8b5 (diff) | |
parent | 8c8f03422e3197a3414a8ed1413fcb9576df0f4b (diff) | |
download | CMake-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 'Source')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 10 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 1bb069f..c0f2495 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -4134,6 +4134,16 @@ std::string cmGeneratorTarget::GetPchCreateCompileOptions( cmStrCat("CMAKE_", language, "_COMPILE_OPTIONS_INVALID_PCH")); } + if (this->GetPropertyAsBool("PCH_INSTANTIATE_TEMPLATES")) { + std::string varName = cmStrCat( + "CMAKE_", language, "_COMPILE_OPTIONS_INSTANTIATE_TEMPLATES_PCH"); + std::string instantiateOption = + this->Makefile->GetSafeDefinition(varName); + if (!instantiateOption.empty()) { + createOptionList = cmStrCat(createOptionList, ";", instantiateOption); + } + } + const std::string createOptVar = cmStrCat("CMAKE_", language, "_COMPILE_OPTIONS_CREATE_PCH"); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ececee7..e076d1e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -381,6 +381,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initPropValue("UNITY_BUILD_BATCH_SIZE", "8"); initPropValue("UNITY_BUILD_MODE", "BATCH"); initPropValue("PCH_WARN_INVALID", "ON"); + initPropValue("PCH_INSTANTIATE_TEMPLATES", "ON"); #ifdef __APPLE__ if (this->GetGlobalGenerator()->IsXcode()) { |