summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-31 18:09:56 (GMT)
committerBrad King <brad.king@kitware.com>2006-08-31 18:09:56 (GMT)
commit409f70bc910f5068e090a4598bdeb44af6361ba4 (patch)
tree99b335d063d623db6c9be23b55b926f7155f7c76 /Source/cmMakefileTargetGenerator.cxx
parentf12742d6cdffd62378a4bbf8eeff0c552d2d9093 (diff)
downloadCMake-409f70bc910f5068e090a4598bdeb44af6361ba4.zip
CMake-409f70bc910f5068e090a4598bdeb44af6361ba4.tar.gz
CMake-409f70bc910f5068e090a4598bdeb44af6361ba4.tar.bz2
ENH: Make sure all custom command outputs are up to date before scanning dependencies. This avoids the need to pass a list of generated files to the dependency scanning code and to rescan after the files have been generated. Currently there is no notion of implicit dependencies of the custom commands themselves so this design is safe. We only need to make sure implicit dependencies are up to date before the make process for the /build part of a target is executed because only this process loads them. This is a step towards fixing bug#3658.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 558a78f..0133a92 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -775,6 +775,23 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
cmLocalGenerator::FULL, cmLocalGenerator::SHELL);
commands.push_back(depCmd.str());
+ // Make sure all custom command outputs in this target are built.
+ const std::vector<cmSourceFile*>& sources =
+ this->Target->GetSourceFiles();
+ for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
+ source != sources.end(); ++source)
+ {
+ if(cmCustomCommand* cc = (*source)->GetCustomCommand())
+ {
+ const std::vector<std::string>& outputs = cc->GetOutputs();
+ for(std::vector<std::string>::const_iterator o = outputs.begin();
+ o != outputs.end(); ++o)
+ {
+ depends.push_back(*o);
+ }
+ }
+ }
+
// Write the rule.
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
depMark.c_str(),
@@ -1024,23 +1041,6 @@ 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.
- const std::vector<cmSourceFile*>& sources =
- this->Target->GetSourceFiles();
- for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
- source != sources.end(); ++source)
- {
- if(cmCustomCommand* cc = (*source)->GetCustomCommand())
- {
- const std::vector<std::string>& outputs = cc->GetOutputs();
- for(std::vector<std::string>::const_iterator o = outputs.begin();
- o != outputs.end(); ++o)
- {
- depends.push_back(*o);
- }
- }
- }
}
// Write the driver rule.