summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-07 18:49:30 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-08 16:20:33 (GMT)
commit26464da5d3919cf0c5a6fc3e34cf143bd65d9938 (patch)
tree7cef3720acb41c2791462803f234fcf3c01e86fd /Source/cmMakefile.cxx
parent142a29b46f6e34b45354425c0da9c49aff9c362c (diff)
downloadCMake-26464da5d3919cf0c5a6fc3e34cf143bd65d9938.zip
CMake-26464da5d3919cf0c5a6fc3e34cf143bd65d9938.tar.gz
CMake-26464da5d3919cf0c5a6fc3e34cf143bd65d9938.tar.bz2
cmMakefile: Drop unnecessary custom command APPEND check
Since commit 777ceaea94 (cmMakefile: Delay custom command creation, 2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at generate time. This includes the append-to-non-existing-command check, so we do not need it at configure time.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx51
1 files changed, 1 insertions, 50 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 14ec689..cad0ad1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -939,8 +939,6 @@ void cmMakefile::DoGenerate(cmLocalGenerator& lg)
action.Value(lg, action.Backtrace);
}
this->GeneratorActionsInvoked = true;
- this->DelayedOutputFiles.clear();
- this->DelayedOutputFilesHaveGenex = false;
// go through all configured files and see which ones still exist.
// we don't want cmake to re-run if a configured file is created and deleted
@@ -1247,16 +1245,11 @@ void cmMakefile::AddCustomCommandOldStyle(
}
}
-bool cmMakefile::AppendCustomCommandToOutput(
+void cmMakefile::AppendCustomCommandToOutput(
const std::string& output, const std::vector<std::string>& depends,
const cmImplicitDependsList& implicit_depends,
const cmCustomCommandLines& commandLines)
{
- // Check as good as we can if there will be a command for this output.
- if (!this->MightHaveCustomCommand(output)) {
- return false;
- }
-
// Validate custom commands.
if (this->ValidateCustomCommand(commandLines)) {
// Dispatch command creation to allow generator expressions in outputs.
@@ -1267,8 +1260,6 @@ bool cmMakefile::AppendCustomCommandToOutput(
implicit_depends, commandLines);
});
}
-
- return true;
}
cmUtilityOutput cmMakefile::GetUtilityOutput(cmTarget* target)
@@ -2271,26 +2262,6 @@ cmSourceFile* cmMakefile::GetSourceFileWithOutput(
return nullptr;
}
-bool cmMakefile::MightHaveCustomCommand(const std::string& name) const
-{
- if (this->DelayedOutputFilesHaveGenex ||
- cmGeneratorExpression::Find(name) != std::string::npos) {
- // Could be more restrictive, but for now we assume that there could always
- // be a match when generator expressions are involved.
- return true;
- }
- // Also see LinearGetSourceFileWithOutput.
- if (!cmSystemTools::FileIsFullPath(name)) {
- return AnyOutputMatches(name, this->DelayedOutputFiles);
- }
- // Otherwise we use an efficient lookup map.
- auto o = this->OutputToSource.find(name);
- if (o != this->OutputToSource.end()) {
- return o->second.SourceMightBeOutput;
- }
- return false;
-}
-
void cmMakefile::AddTargetByproducts(
cmTarget* target, const std::vector<std::string>& byproducts)
{
@@ -2339,7 +2310,6 @@ void cmMakefile::UpdateOutputToSourceMap(std::string const& output,
SourceEntry entry;
entry.Sources.Source = source;
entry.Sources.SourceIsByproduct = byproduct;
- entry.SourceMightBeOutput = !byproduct;
auto pr = this->OutputToSource.emplace(output, entry);
if (!pr.second) {
@@ -2349,7 +2319,6 @@ void cmMakefile::UpdateOutputToSourceMap(std::string const& output,
(current.Sources.SourceIsByproduct && !byproduct)) {
current.Sources.Source = source;
current.Sources.SourceIsByproduct = false;
- current.SourceMightBeOutput = true;
} else {
// Multiple custom commands produce the same output but may
// be attached to a different source file (MAIN_DEPENDENCY).
@@ -3676,9 +3645,6 @@ void cmMakefile::CreateGeneratedOutputs(
for (std::string const& o : outputs) {
if (cmGeneratorExpression::Find(o) == std::string::npos) {
this->GetOrCreateGeneratedSource(o);
- this->AddDelayedOutput(o);
- } else {
- this->DelayedOutputFilesHaveGenex = true;
}
}
}
@@ -3693,21 +3659,6 @@ void cmMakefile::CreateGeneratedByproducts(
}
}
-void cmMakefile::AddDelayedOutput(std::string const& output)
-{
- // Note that this vector might contain the output names in a different order
- // than in source file iteration order.
- this->DelayedOutputFiles.push_back(output);
-
- SourceEntry entry;
- entry.SourceMightBeOutput = true;
-
- auto pr = this->OutputToSource.emplace(output, entry);
- if (!pr.second) {
- pr.first->second.SourceMightBeOutput = true;
- }
-}
-
void cmMakefile::AddTargetObject(std::string const& tgtName,
std::string const& objFile)
{