Commit 8b0575c4 authored by Brad King's avatar Brad King
Browse files

ENH: Added cmTarget::GetLanguages method to centralize computation of the list...

ENH: Added cmTarget::GetLanguages method to centralize computation of the list of languages compiled in a target.
parent 9f2de08f
...@@ -731,8 +731,7 @@ cmGlobalUnixMakefileGenerator3 ...@@ -731,8 +731,7 @@ cmGlobalUnixMakefileGenerator3
makefileName = localName; makefileName = localName;
makefileName += "/build.make"; makefileName += "/build.make";
bool needRequiresStep = bool needRequiresStep = this->NeedRequiresStep(t->second);
this->NeedRequiresStep(lg,t->second.GetName());
lg->WriteDivider(ruleFileStream); lg->WriteDivider(ruleFileStream);
ruleFileStream ruleFileStream
...@@ -851,7 +850,7 @@ cmGlobalUnixMakefileGenerator3 ...@@ -851,7 +850,7 @@ cmGlobalUnixMakefileGenerator3
t->second.GetName(), depends, commands, true); t->second.GetName(), depends, commands, true);
// Add rules to prepare the target for installation. // Add rules to prepare the target for installation.
if(t->second.NeedRelinkBeforeInstall()) if(!exclude && t->second.NeedRelinkBeforeInstall())
{ {
localName = lg->GetRelativeTargetDirectory(t->second); localName = lg->GetRelativeTargetDirectory(t->second);
localName += "/preinstall"; localName += "/preinstall";
...@@ -1168,18 +1167,17 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule ...@@ -1168,18 +1167,17 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
bool cmGlobalUnixMakefileGenerator3 bool cmGlobalUnixMakefileGenerator3
::NeedRequiresStep(cmLocalUnixMakefileGenerator3 *lg,const char *name) ::NeedRequiresStep(cmTarget const& target)
{ {
std::map<cmStdString,cmLocalUnixMakefileGenerator3::IntegrityCheckSet>& std::set<cmStdString> languages;
checkSet = lg->GetIntegrityCheckSet()[name]; target.GetLanguages(languages);
for(std::map<cmStdString, for(std::set<cmStdString>::const_iterator l = languages.begin();
cmLocalUnixMakefileGenerator3::IntegrityCheckSet>::const_iterator l != languages.end(); ++l)
l = checkSet.begin(); l != checkSet.end(); ++l)
{ {
std::string name2 = "CMAKE_NEEDS_REQUIRES_STEP_"; std::string var = "CMAKE_NEEDS_REQUIRES_STEP_";
name2 += l->first; var += *l;
name2 += "_FLAG"; var += "_FLAG";
if(lg->GetMakefile()->GetDefinition(name2.c_str())) if(target.GetMakefile()->GetDefinition(var.c_str()))
{ {
return true; return true;
} }
......
...@@ -165,7 +165,7 @@ protected: ...@@ -165,7 +165,7 @@ protected:
cmTarget &target); cmTarget &target);
// does this generator need a requires step for any of its targets // does this generator need a requires step for any of its targets
bool NeedRequiresStep(cmLocalUnixMakefileGenerator3 *lg, const char *); bool NeedRequiresStep(cmTarget const&);
// Setup target names // Setup target names
virtual const char* GetAllTargetName() { return "all"; } virtual const char* GetAllTargetName() { return "all"; }
......
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