summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx10
-rw-r--r--Source/cmTarget.cxx1
2 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 7c526a0..de981c1 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4078,6 +4078,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 bea9001..6aa23c2 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -377,6 +377,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()) {