Ninja/Swift: Remove redundant calls to ConvertToNinjaPath

`GetSourceFilePath` already handles converting to a Ninja path.
This commit is contained in:
Brad King
2021-05-20 14:21:56 -04:00
parent 7cf4dfcf78
commit ef553410e2
2 changed files with 4 additions and 7 deletions

View File

@@ -1072,9 +1072,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
cmLocalGenerator const* LocalGen = this->GetLocalGenerator();
for (const auto& source : sources) {
oss << " "
<< LocalGen->ConvertToOutputFormat(
this->ConvertToNinjaPath(this->GetSourceFilePath(source)),
cmOutputConverter::SHELL);
<< LocalGen->ConvertToOutputFormat(this->GetSourceFilePath(source),
cmOutputConverter::SHELL);
}
return oss.str();
}();
@@ -1094,8 +1093,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
for (const auto& source : sources) {
linkBuild.Outputs.push_back(
this->ConvertToNinjaPath(this->GetObjectFilePath(source, config)));
linkBuild.ExplicitDeps.push_back(
this->ConvertToNinjaPath(this->GetSourceFilePath(source)));
linkBuild.ExplicitDeps.emplace_back(this->GetSourceFilePath(source));
}
linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]);
} else {

View File

@@ -1575,8 +1575,7 @@ void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang,
void cmNinjaTargetGenerator::EmitSwiftDependencyInfo(
cmSourceFile const* source, const std::string& config)
{
std::string const sourceFilePath =
this->ConvertToNinjaPath(this->GetSourceFilePath(source));
std::string const sourceFilePath = this->GetSourceFilePath(source);
std::string const objectFilePath =
this->ConvertToNinjaPath(this->GetObjectFilePath(source, config));
std::string const swiftDepsPath = [source, objectFilePath]() -> std::string {