Commit ddb04080 authored by Brad King's avatar Brad King
Browse files

ENH: Added option CMAKE_SKIP_RULE_DEPENDENCY to skip making build rules depend...

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.
parent 200c98fc
......@@ -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,
......@@ -2605,6 +2605,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
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment