From 7a1c7736cb3f867f916509d38bc88e75eaa7be3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=B6nle?= Date: Thu, 7 May 2020 09:39:07 +0200 Subject: 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 --- Source/cmLocalGenerator.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- cgit v0.12 From 605d6c65c9ecf0128f706b0790b4950da231eb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=B6nle?= Date: Thu, 7 May 2020 09:39:07 +0200 Subject: 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 --- Source/cmLocalGenerator.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b862449..9aca775 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2732,9 +2732,11 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) std::string pchSourceObj = reuseTarget->GetPchFileObject(config, lang, arch); + 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); -- cgit v0.12