diff options
author | Brad King <brad.king@kitware.com> | 2022-02-04 13:19:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-02-04 13:19:18 (GMT) |
commit | ce00bfd75ec5ad3f046a1c99285047d7ac98bc61 (patch) | |
tree | 19321b885aeb7240ce9e1c2c68a4386328668fa1 | |
parent | 01b89d2547a04b25c462444dd5aac751f0ec54b0 (diff) | |
parent | dd1e2cc80c1450cc6fcb35d114f4cf999e4c0315 (diff) | |
download | CMake-ce00bfd75ec5ad3f046a1c99285047d7ac98bc61.zip CMake-ce00bfd75ec5ad3f046a1c99285047d7ac98bc61.tar.gz CMake-ce00bfd75ec5ad3f046a1c99285047d7ac98bc61.tar.bz2 |
Merge topic 'vs-simplify-pch' into release-3.23
dd1e2cc80c VS: Simplify generation of per-source PCH settings
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6950
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index be46825..7b197fa 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2736,11 +2736,15 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( if (needsPCHFlags) { // Add precompile headers compile options. - std::string expandedOptions; - std::string pchOptions; if (makePCH) { - pchOptions = - this->GeneratorTarget->GetPchCreateCompileOptions(config, lang); + clOptions.AddFlag("PrecompiledHeader", "Create"); + std::string pchHeader = + this->GeneratorTarget->GetPchHeader(config, lang); + clOptions.AddFlag("PrecompiledHeaderFile", pchHeader); + std::string pchFile = + this->GeneratorTarget->GetPchFile(config, lang); + clOptions.AddFlag("PrecompiledHeaderOutputFile", pchFile); + clOptions.AddFlag("ForcedIncludeFiles", pchHeader); } else if (useNoPCH) { clOptions.AddFlag("PrecompiledHeader", "NotUsing"); } else if (useSharedPCH) { @@ -2748,12 +2752,15 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( this->GeneratorTarget->GetPchHeader(config, lang); clOptions.AddFlag("ForcedIncludeFiles", pchHeader); } else if (useDifferentLangPCH) { - pchOptions = - this->GeneratorTarget->GetPchUseCompileOptions(config, lang); + clOptions.AddFlag("PrecompiledHeader", "Use"); + std::string pchHeader = + this->GeneratorTarget->GetPchHeader(config, lang); + clOptions.AddFlag("PrecompiledHeaderFile", pchHeader); + std::string pchFile = + this->GeneratorTarget->GetPchFile(config, lang); + clOptions.AddFlag("PrecompiledHeaderOutputFile", pchFile); + clOptions.AddFlag("ForcedIncludeFiles", pchHeader); } - this->LocalGenerator->AppendCompileOptions(expandedOptions, - pchOptions); - clOptions.Parse(expandedOptions); } if (!options.empty()) { |