From ef553410e24959dac8413a7f2277d42530fbc0f7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 20 May 2021 14:21:56 -0400 Subject: Ninja/Swift: Remove redundant calls to ConvertToNinjaPath `GetSourceFilePath` already handles converting to a Ninja path. --- Source/cmNinjaNormalTargetGenerator.cxx | 8 +++----- Source/cmNinjaTargetGenerator.cxx | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 1b514b8..e443981 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -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 { diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 3ebf364..669953f 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -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 { -- cgit v0.12