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
This commit is contained in:
Kyle Edwards 2020-08-03 10:45:17 -04:00 committed by Brad King
parent 103d6faed9
commit cdb50af2f6

View File

@ -748,12 +748,8 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement(
static_cast<int>(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.