Browse Source

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
Andreas Schönle 5 years ago
parent
commit
7a1c7736cb
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Source/cmLocalGenerator.cxx

+ 3 - 1
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);
           }