summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-20 18:21:56 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-25 14:48:25 (GMT)
commitef553410e24959dac8413a7f2277d42530fbc0f7 (patch)
tree6f4157aa2545b7e0c6f736adcab722ead0b591df /Source
parent7cf4dfcf787bc67c884a1c64a3b78c41bca720bb (diff)
downloadCMake-ef553410e24959dac8413a7f2277d42530fbc0f7.zip
CMake-ef553410e24959dac8413a7f2277d42530fbc0f7.tar.gz
CMake-ef553410e24959dac8413a7f2277d42530fbc0f7.tar.bz2
Ninja/Swift: Remove redundant calls to ConvertToNinjaPath
`GetSourceFilePath` already handles converting to a Ninja path.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx8
-rw-r--r--Source/cmNinjaTargetGenerator.cxx3
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 {