summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schönle <a.schoenle@abberior-instruments.com>2020-05-07 07:39:07 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-07 13:55:04 (GMT)
commit7a1c7736cb3f867f916509d38bc88e75eaa7be3f (patch)
tree6937c310eddaedc31189d9c77ce2611e9f0ef224
parent615129f3ebd308abeaaee7f5f0689e7fc4616c28 (diff)
downloadCMake-7a1c7736cb3f867f916509d38bc88e75eaa7be3f.zip
CMake-7a1c7736cb3f867f916509d38bc88e75eaa7be3f.tar.gz
CMake-7a1c7736cb3f867f916509d38bc88e75eaa7be3f.tar.bz2
PCH: Fix REUSE_FROM in multi-config generators
Since commit a55df20499 (Multi-Ninja: Add precompile headers support, 2020-01-10, v3.17.0-rc1~136^2) the re-used PCH file object is added once for each configuration to flags used for all configurations. Put it in the flags for only the corresponding configuration instead. Fixes: #20680
-rw-r--r--Source/cmLocalGenerator.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c2ec5f5..f592b7b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2604,9 +2604,11 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
std::string pchSourceObj =
reuseTarget->GetPchFileObject(config, lang);
+ const std::string configUpper = cmSystemTools::UpperCase(config);
+
// Link to the pch object file
target->Target->AppendProperty(
- "LINK_FLAGS",
+ cmStrCat("LINK_FLAGS_", configUpper),
cmStrCat(" ", this->ConvertToOutputFormat(pchSourceObj, SHELL)),
true);
}