summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorKulla Christoph <christoph.kulla@de.bosch.com>2016-08-05 12:39:31 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-30 13:05:18 (GMT)
commit048d1adb4ede50e49dce00873a5961e424e149f9 (patch)
tree2f7ec3c0e5a773820c8cd74efa90c12124bbcce3 /Source/cmMakefile.cxx
parent98caa14cc84cc659c2c5b51f84c6547b57c89c30 (diff)
downloadCMake-048d1adb4ede50e49dce00873a5961e424e149f9.zip
CMake-048d1adb4ede50e49dce00873a5961e424e149f9.tar.gz
CMake-048d1adb4ede50e49dce00873a5961e424e149f9.tar.bz2
add_custom_command: Add DEPFILE option for Ninja
Provide a way for custom commands to inform the ninja build tool about their implicit dependencies. For now simply make use of the option an error on other generators. Closes: #15479
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6e47797..d1fddca 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -701,7 +701,7 @@ void cmMakefile::AddCustomCommandToTarget(
const std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines, cmTarget::CustomCommandType type,
const char* comment, const char* workingDir, bool escapeOldStyle,
- bool uses_terminal)
+ bool uses_terminal, const std::string& depfile)
{
// Find the target to which to add the custom command.
cmTargets::iterator ti = this->Targets.find(target);
@@ -773,6 +773,7 @@ void cmMakefile::AddCustomCommandToTarget(
cc.SetEscapeOldStyle(escapeOldStyle);
cc.SetEscapeAllowMakeVars(true);
cc.SetUsesTerminal(uses_terminal);
+ cc.SetDepfile(depfile);
switch (type) {
case cmTarget::PRE_BUILD:
ti->second.AddPreBuildCommand(cc);
@@ -792,7 +793,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
const std::vector<std::string>& depends, const std::string& main_dependency,
const cmCustomCommandLines& commandLines, const char* comment,
const char* workingDir, bool replace, bool escapeOldStyle,
- bool uses_terminal)
+ bool uses_terminal, const std::string& depfile)
{
// Make sure there is at least one output.
if (outputs.empty()) {
@@ -886,6 +887,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
cc->SetEscapeOldStyle(escapeOldStyle);
cc->SetEscapeAllowMakeVars(true);
cc->SetUsesTerminal(uses_terminal);
+ cc->SetDepfile(depfile);
file->SetCustomCommand(cc);
this->UpdateOutputToSourceMap(outputs, file);
}
@@ -923,14 +925,14 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
const std::string& output, const std::vector<std::string>& depends,
const std::string& main_dependency, const cmCustomCommandLines& commandLines,
const char* comment, const char* workingDir, bool replace,
- bool escapeOldStyle, bool uses_terminal)
+ bool escapeOldStyle, bool uses_terminal, const std::string& depfile)
{
std::vector<std::string> outputs;
outputs.push_back(output);
std::vector<std::string> no_byproducts;
return this->AddCustomCommandToOutput(
outputs, no_byproducts, depends, main_dependency, commandLines, comment,
- workingDir, replace, escapeOldStyle, uses_terminal);
+ workingDir, replace, escapeOldStyle, uses_terminal, depfile);
}
void cmMakefile::AddCustomCommandOldStyle(