diff options
author | Brad King <brad.king@kitware.com> | 2005-03-08 18:43:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-03-08 18:43:17 (GMT) |
commit | ddb04080076529f8c0fa781b8f4a0a6453d1fac9 (patch) | |
tree | 00b88a1b0280213936b3022b289ce33093e7b12d | |
parent | 200c98fc327ba82e52d9bf6502c5ba478506c6aa (diff) | |
download | CMake-ddb04080076529f8c0fa781b8f4a0a6453d1fac9.zip CMake-ddb04080076529f8c0fa781b8f4a0a6453d1fac9.tar.gz CMake-ddb04080076529f8c0fa781b8f4a0a6453d1fac9.tar.bz2 |
ENH: Added option CMAKE_SKIP_RULE_DEPENDENCY to skip making build rules depend on their own rule files. It can be added to the cache by the user or added by the project in a list file.
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator2.cxx | 27 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator2.h | 2 |
2 files changed, 23 insertions, 6 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx index 0289a8e..c815068 100644 --- a/Source/cmLocalUnixMakefileGenerator2.cxx +++ b/Source/cmLocalUnixMakefileGenerator2.cxx @@ -527,7 +527,7 @@ cmLocalUnixMakefileGenerator2 depends.push_back(i->c_str()); } } - depends.push_back(ruleFileName); + this->AppendRuleDepend(depends, ruleFileName.c_str()); // Write the dependency generation rule. { @@ -723,7 +723,7 @@ cmLocalUnixMakefileGenerator2 this->AppendCustomDepend(depends, cc); // Add a dependency on the rule file itself. - depends.push_back(ruleFileName); + this->AppendRuleDepend(depends, ruleFileName.c_str()); // Write the rule. const char* comment = 0; @@ -807,7 +807,7 @@ cmLocalUnixMakefileGenerator2 this->AppendTargetDepends(depends, target); // Add a dependency on the rule file itself. - depends.push_back(ruleFileName); + this->AppendRuleDepend(depends, ruleFileName.c_str()); // Write the rule. this->WriteMakeRule(ruleFileStream, 0, @@ -1585,7 +1585,7 @@ cmLocalUnixMakefileGenerator2 this->AppendTargetDepends(depends, target); // Add a dependency on the rule file itself. - depends.push_back(ruleFileName); + this->AppendRuleDepend(depends, ruleFileName); // Construct the full path to the executable that will be generated. std::string targetFullPath = m_ExecutableOutputPath; @@ -1850,7 +1850,7 @@ cmLocalUnixMakefileGenerator2 this->AppendTargetDepends(depends, target); // Add a dependency on the rule file itself. - depends.push_back(ruleFileName); + this->AppendRuleDepend(depends, ruleFileName); // Get the language to use for linking this library. const char* linkLanguage = @@ -2073,7 +2073,7 @@ cmLocalUnixMakefileGenerator2 } // Depend on the rule file itself. - depends.push_back(ruleFileName); + this->AppendRuleDepend(depends, ruleFileName); // Write the rule. this->WriteMakeRule(ruleFileStream, 0, @@ -2608,6 +2608,21 @@ cmLocalUnixMakefileGenerator2 //---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator2 +::AppendRuleDepend(std::vector<std::string>& depends, + const char* ruleFileName) +{ + // Add a dependency on the rule file itself unless an option to skip + // it is specifically enabled by the user or project. + const char* nodep = m_Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY"); + if(!nodep || cmSystemTools::IsOff(nodep)) + { + depends.push_back(ruleFileName); + } +} + +//---------------------------------------------------------------------------- +void +cmLocalUnixMakefileGenerator2 ::AppendCustomDepends(std::vector<std::string>& depends, const std::vector<cmCustomCommand>& ccs) { diff --git a/Source/cmLocalUnixMakefileGenerator2.h b/Source/cmLocalUnixMakefileGenerator2.h index 2fa163c..2026abd 100644 --- a/Source/cmLocalUnixMakefileGenerator2.h +++ b/Source/cmLocalUnixMakefileGenerator2.h @@ -207,6 +207,8 @@ protected: void AppendTargetDepends(std::vector<std::string>& depends, const cmTarget& target); void AppendAnyDepend(std::vector<std::string>& depends, const char* name); + void AppendRuleDepend(std::vector<std::string>& depends, + const char* ruleFileName); void AppendCustomDepends(std::vector<std::string>& depends, const std::vector<cmCustomCommand>& ccs); void AppendCustomDepend(std::vector<std::string>& depends, |