summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-19 14:14:53 -0400
committerBrad King <brad.king@kitware.com>2021-05-25 10:48:25 -0400
commitfb3a57575aa91c636963a12b7d0b6ec64bfce241 (patch)
treeaabc6db45fe5bf76f118b7fe5cc29de3abc5668f /Source
parent0f2b1c9d1bc4f802a4ecb647f2ca7258fc378df5 (diff)
downloadcmake-fb3a57575aa91c636963a12b7d0b6ec64bfce241.tar.gz
cmNinjaTargetGenerator: Rename source file path lookup method for clarity
The `GetSourceFilePath` method is meant only for compiled sources, and automatically handles converting it to a path for the Ninja build manifest. Rename the method to clarify both.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx8
-rw-r--r--Source/cmNinjaTargetGenerator.cxx9
-rw-r--r--Source/cmNinjaTargetGenerator.h2
3 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index e443981418..e5e57d28a0 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -1072,8 +1072,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
cmLocalGenerator const* LocalGen = this->GetLocalGenerator();
for (const auto& source : sources) {
oss << " "
- << LocalGen->ConvertToOutputFormat(this->GetSourceFilePath(source),
- cmOutputConverter::SHELL);
+ << LocalGen->ConvertToOutputFormat(
+ this->GetCompiledSourceNinjaPath(source),
+ cmOutputConverter::SHELL);
}
return oss.str();
}();
@@ -1093,7 +1094,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
for (const auto& source : sources) {
linkBuild.Outputs.push_back(
this->ConvertToNinjaPath(this->GetObjectFilePath(source, config)));
- linkBuild.ExplicitDeps.emplace_back(this->GetSourceFilePath(source));
+ linkBuild.ExplicitDeps.emplace_back(
+ this->GetCompiledSourceNinjaPath(source));
}
linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]);
} else {
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 5c365c4e90..5499ff7c5b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -379,7 +379,7 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps(
return result;
}
-std::string cmNinjaTargetGenerator::GetSourceFilePath(
+std::string cmNinjaTargetGenerator::GetCompiledSourceNinjaPath(
cmSourceFile const* source) const
{
return this->ConvertToNinjaPath(source->GetFullPath());
@@ -1199,8 +1199,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
const std::string& fileConfig, bool firstForConfig)
{
std::string const language = source->GetLanguage();
- std::string const sourceFilePath =
- language == "RC" ? source->GetFullPath() : this->GetSourceFilePath(source);
+ std::string const sourceFilePath = language == "RC"
+ ? source->GetFullPath()
+ : this->GetCompiledSourceNinjaPath(source);
std::string const objectDir = this->ConvertToNinjaPath(
cmStrCat(this->GeneratorTarget->GetSupportDirectory(),
this->GetGlobalGenerator()->ConfigDirectory(config)));
@@ -1575,7 +1576,7 @@ void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang,
void cmNinjaTargetGenerator::EmitSwiftDependencyInfo(
cmSourceFile const* source, const std::string& config)
{
- std::string const sourceFilePath = this->GetSourceFilePath(source);
+ std::string const sourceFilePath = this->GetCompiledSourceNinjaPath(source);
std::string const objectFilePath =
this->ConvertToNinjaPath(this->GetObjectFilePath(source, config));
std::string const swiftDepsPath = [source, objectFilePath]() -> std::string {
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 3a28cef94c..72f6b5f224 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -116,7 +116,7 @@ protected:
bool ignoreType = false) const;
/// @return the source file path for the given @a source.
- std::string GetSourceFilePath(cmSourceFile const* source) const;
+ std::string GetCompiledSourceNinjaPath(cmSourceFile const* source) const;
/// @return the object file path for the given @a source.
std::string GetObjectFilePath(cmSourceFile const* source,