summaryrefslogtreecommitdiff
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx29
1 files changed, 24 insertions, 5 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index cd8239c864..cc16069e52 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -35,6 +35,7 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator()
this->BuildFileStream = 0;
this->InfoFileStream = 0;
this->FlagFileStream = 0;
+ this->DriveCustomCommandsOnDepends = false;
}
cmMakefileTargetGenerator *
@@ -775,6 +776,23 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
commands.push_back(depCmd.str());
// Make sure all custom command outputs in this target are built.
+ if(this->DriveCustomCommandsOnDepends)
+ {
+ this->DriveCustomCommands(depends);
+ }
+
+ // Write the rule.
+ this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+ depMark.c_str(),
+ depends, commands, false);
+}
+
+//----------------------------------------------------------------------------
+void
+cmMakefileTargetGenerator
+::DriveCustomCommands(std::vector<std::string>& depends)
+{
+ // Depend on all custom command outputs.
const std::vector<cmSourceFile*>& sources =
this->Target->GetSourceFiles();
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
@@ -790,11 +808,6 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
}
}
}
-
- // Write the rule.
- this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
- depMark.c_str(),
- depends, commands, false);
}
//----------------------------------------------------------------------------
@@ -1040,6 +1053,12 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
{
// Setup the comment for the main build driver.
comment = "Rule to build all files generated by this target.";
+
+ // Make sure all custom command outputs in this target are built.
+ if(!this->DriveCustomCommandsOnDepends)
+ {
+ this->DriveCustomCommands(depends);
+ }
}
// Write the driver rule.