瀏覽代碼

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 年之前
父節點
當前提交
605d6c65c9
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Source/cmLocalGenerator.cxx

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