summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-07-15 17:12:02 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-07-16 15:57:46 (GMT)
commit99ed39b011f170f8a6c6ca91d6d12c4858a74d22 (patch)
treee25c91a8e364967fa9a3407bbf7d13a92d680700
parente647949539f4704a00eddac2357d59ceeb8bc0ca (diff)
downloadCMake-99ed39b011f170f8a6c6ca91d6d12c4858a74d22.zip
CMake-99ed39b011f170f8a6c6ca91d6d12c4858a74d22.tar.gz
CMake-99ed39b011f170f8a6c6ca91d6d12c4858a74d22.tar.bz2
Ninja Multi-Config: Make link response files per-config
Fixes: #20961
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 885703f..eed463d 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -748,8 +748,13 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement(
static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
globalGen->GetRuleCmdLength(this->LanguageLinkerDeviceRule(config));
- build.RspFile = this->ConvertToNinjaPath(std::string("CMakeFiles/") +
- genTarget->GetName() + ".rsp");
+ std::string path = localGen.GetHomeRelativeOutputPath();
+ if (!path.empty()) {
+ path += '/';
+ }
+ build.RspFile = this->ConvertToNinjaPath(
+ cmStrCat(path, "CMakeFiles/", genTarget->GetName(),
+ globalGen->IsMultiConfig() ? cmStrCat('.', config) : "", ".rsp"));
// Gather order-only dependencies.
this->GetLocalGenerator()->AppendTargetDepends(
@@ -1157,8 +1162,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
globalGen->GetRuleCmdLength(linkBuild.Rule);
}
- linkBuild.RspFile = this->ConvertToNinjaPath(std::string("CMakeFiles/") +
- gt->GetName() + ".rsp");
+ std::string path = localGen.GetHomeRelativeOutputPath();
+ if (!path.empty()) {
+ path += '/';
+ }
+ linkBuild.RspFile = this->ConvertToNinjaPath(
+ cmStrCat(path, "CMakeFiles/", gt->GetName(),
+ globalGen->IsMultiConfig() ? cmStrCat('.', config) : "", ".rsp"));
// Gather order-only dependencies.
this->GetLocalGenerator()->AppendTargetDepends(gt, linkBuild.OrderOnlyDeps,