Ver código fonte

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 anos atrás
pai
commit
605d6c65c9
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      Source/cmLocalGenerator.cxx

+ 3 - 1
Source/cmLocalGenerator.cxx

@@ -2732,9 +2732,11 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
               std::string pchSourceObj =
               std::string pchSourceObj =
                 reuseTarget->GetPchFileObject(config, lang, arch);
                 reuseTarget->GetPchFileObject(config, lang, arch);
 
 
+              const std::string configUpper = cmSystemTools::UpperCase(config);
+
               // Link to the pch object file
               // Link to the pch object file
               target->Target->AppendProperty(
               target->Target->AppendProperty(
-                "LINK_FLAGS",
+                cmStrCat("LINK_FLAGS_", configUpper),
                 cmStrCat(" ",
                 cmStrCat(" ",
                          this->ConvertToOutputFormat(pchSourceObj, SHELL)),
                          this->ConvertToOutputFormat(pchSourceObj, SHELL)),
                 true);
                 true);