summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-30 15:17:24 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-15 12:00:52 (GMT)
commitd29da8ed3eb757d10643039aa738bad0727c1b6a (patch)
tree4fafdbdd3a0182055c26a3dd94a3af5049434a01 /Source/cmMakefile.cxx
parent2b1cc175ee913477c3f1dc6978dd63b2fdaff7e2 (diff)
downloadCMake-d29da8ed3eb757d10643039aa738bad0727c1b6a.zip
CMake-d29da8ed3eb757d10643039aa738bad0727c1b6a.tar.gz
CMake-d29da8ed3eb757d10643039aa738bad0727c1b6a.tar.bz2
cmMakefile: Simplify custom target 'force' output name generation
Remove unnecessary check of policy CMP0049. The policy can never trigger on our internally-generated name because it has no variable references. The rename in commit 0ed5ce4cd8 (cmTarget: Rename AddSource method for backward compatibility., 2014-03-17, v3.1.0-rc1~688^2~17) made it look like this code path depended on CMP0049. Then commit 0e1faa28cb (cmMakefile: Separate custom command setup from actual creation, 2019-09-14, v3.16.0-rc1~85^2) and commit ea1bed34b2 (cmMakefile: Extract utilities used for creation of custom commands, 2019-09-21, v3.16.0-rc1~52^2~1) built additional infrastructure to thread that dependence through the call stack. Remove it all.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx27
1 files changed, 10 insertions, 17 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4e93785..6743a89 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1257,25 +1257,18 @@ void cmMakefile::AppendCustomCommandToOutput(
}
}
-cmUtilityOutput cmMakefile::GetUtilityOutput(cmTarget* target)
+std::string cmMakefile::GetUtilityOutput(cmTarget* target)
{
std::string force = cmStrCat(this->GetCurrentBinaryDirectory(),
"/CMakeFiles/", target->GetName());
- std::string forceCMP0049 = target->GetSourceCMP0049(force);
- {
- cmSourceFile* sf = nullptr;
- if (!forceCMP0049.empty()) {
- sf = this->GetOrCreateSource(forceCMP0049, false,
- cmSourceFileLocationKind::Known);
- }
- // The output is not actually created so mark it symbolic.
- if (sf) {
- sf->SetProperty("SYMBOLIC", "1");
- } else {
- cmSystemTools::Error("Could not get source file entry for " + force);
- }
+ // The output is not actually created so mark it symbolic.
+ if (cmSourceFile* sf = this->GetOrCreateSource(
+ force, false, cmSourceFileLocationKind::Known)) {
+ sf->SetProperty("SYMBOLIC", "1");
+ } else {
+ cmSystemTools::Error("Could not get source file entry for " + force);
}
- return { std::move(force), std::move(forceCMP0049) };
+ return force;
}
cmTarget* cmMakefile::AddUtilityCommand(
@@ -1295,8 +1288,8 @@ cmTarget* cmMakefile::AddUtilityCommand(
}
// Get the output name of the utility target and mark it generated.
- cmUtilityOutput force = this->GetUtilityOutput(target);
- this->GetOrCreateGeneratedSource(force.Name);
+ std::string force = this->GetUtilityOutput(target);
+ this->GetOrCreateGeneratedSource(force);
// Always create the byproduct sources and mark them generated.
this->CreateGeneratedOutputs(byproducts);