summaryrefslogtreecommitdiff
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2021-12-12 15:01:20 +0900
committerBrad King <brad.king@kitware.com>2021-12-14 10:48:43 -0500
commit780341f360773d7b3b766b835bd539f46397e0a6 (patch)
tree767cdbaa73a9b9c7c38a31ab962034f1386d918f /Source/cmAddCustomCommandCommand.cxx
parenta6fa3fa136c291c36aefbc79b62995a63bf9107b (diff)
downloadcmake-780341f360773d7b3b766b835bd539f46397e0a6.tar.gz
cmCustomCommand: Track main dependency explicitly
Store the main dependency as the first entry in the dependency list plus a boolean member indicating its existence. Note that this slightly changes existing behavior: the main dependency was previously the last entry of the dependency list.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 0798ed466a..831e9c7d59 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -335,9 +335,10 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
} else if (target.empty()) {
// Target is empty, use the output.
cc->SetOutputs(output);
+ cc->SetMainDependency(main_dependency);
cc->SetDepends(depends);
cc->SetImplicitDepends(implicit_depends);
- mf.AddCustomCommandToOutput(main_dependency, std::move(cc));
+ mf.AddCustomCommandToOutput(std::move(cc));
} else if (!byproducts.empty()) {
status.SetError("BYPRODUCTS may not be specified with SOURCE signatures");
return false;