From cdb50af2f6801bf760376c9d78d39131be93b987 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Mon, 3 Aug 2020 10:45:17 -0400 Subject: Ninja: Restore shorter path to response files In commit 99ed39b011 (Ninja Multi-Config: Make link response files per-config, 2020-07-15, v3.17.4~3^2), we added the target directory to the response file under the mistaken assumption that two different targets with the same name could be in different directories. However, this causes the path to the response file to be too long to fit on a command line. Take the path back out, while leaving in the per-config split. Fixes: #21050 --- Source/cmNinjaNormalTargetGenerator.cxx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index eed463d..ba2ea5b 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -748,12 +748,8 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement( static_cast(cmSystemTools::CalculateCommandLineLengthLimit()) - globalGen->GetRuleCmdLength(this->LanguageLinkerDeviceRule(config)); - std::string path = localGen.GetHomeRelativeOutputPath(); - if (!path.empty()) { - path += '/'; - } build.RspFile = this->ConvertToNinjaPath( - cmStrCat(path, "CMakeFiles/", genTarget->GetName(), + cmStrCat("CMakeFiles/", genTarget->GetName(), globalGen->IsMultiConfig() ? cmStrCat('.', config) : "", ".rsp")); // Gather order-only dependencies. @@ -1162,12 +1158,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( globalGen->GetRuleCmdLength(linkBuild.Rule); } - std::string path = localGen.GetHomeRelativeOutputPath(); - if (!path.empty()) { - path += '/'; - } linkBuild.RspFile = this->ConvertToNinjaPath( - cmStrCat(path, "CMakeFiles/", gt->GetName(), + cmStrCat("CMakeFiles/", gt->GetName(), globalGen->IsMultiConfig() ? cmStrCat('.', config) : "", ".rsp")); // Gather order-only dependencies. -- cgit v0.12