summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-05-01 17:51:25 (GMT)
committerBrad King <brad.king@kitware.com>2007-05-01 17:51:25 (GMT)
commitc51c245efa2cf6608e97862edbf7c1ba038e0cf2 (patch)
tree806b43b07962b817819f38590df63cfe1b96c81c /Source/cmMakefileTargetGenerator.cxx
parentef0b9ff2ccb1b40c23fb90d9feb36d261642eef1 (diff)
downloadCMake-c51c245efa2cf6608e97862edbf7c1ba038e0cf2.zip
CMake-c51c245efa2cf6608e97862edbf7c1ba038e0cf2.tar.gz
CMake-c51c245efa2cf6608e97862edbf7c1ba038e0cf2.tar.bz2
BUG: A utility target should not run the custom commands from its source files directly. The target-level rule must add dependencies on the file-level custom commands to drive them. This bug was introduced by the "fix" to bug 4377. This also restores the documented behavior that PRE_BUILD rules are treated as PRE_LINK rules on non-VS generators. Also fixed custom command dependencies on the rule file build.make so that custom commands re-run when the commands themselves change.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 523a6f7..54d7835 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -35,7 +35,7 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator()
this->BuildFileStream = 0;
this->InfoFileStream = 0;
this->FlagFileStream = 0;
- this->DriveCustomCommandsOnDepends = false;
+ this->CustomCommandDriver = OnBuild;
}
cmMakefileTargetGenerator *
@@ -788,7 +788,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
commands.push_back(depCmd.str());
// Make sure all custom command outputs in this target are built.
- if(this->DriveCustomCommandsOnDepends)
+ if(this->CustomCommandDriver == OnDepends)
{
this->DriveCustomCommands(depends);
}
@@ -874,6 +874,10 @@ void cmMakefileTargetGenerator
std::vector<std::string> depends;
this->LocalGenerator->AppendCustomDepend(depends, cc);
+ // Add a dependency on the rule file itself.
+ this->LocalGenerator->AppendRuleDepend(depends,
+ this->BuildFileNameFull.c_str());
+
// Check whether we need to bother checking for a symbolic output.
bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
@@ -1096,7 +1100,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
comment = "Rule to build all files generated by this target.";
// Make sure all custom command outputs in this target are built.
- if(!this->DriveCustomCommandsOnDepends)
+ if(this->CustomCommandDriver == OnBuild)
{
this->DriveCustomCommands(depends);
}