diff options
author | Brad King <brad.king@kitware.com> | 2007-08-03 13:39:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-08-03 13:39:32 (GMT) |
commit | bf0c200f0a8f494f3e78465ab8be0763ecdcbb6d (patch) | |
tree | babb76a36cefee89dfc8040cfd61f326a466656f | |
parent | 1c508b94ae680fc137638d75dee767505522665a (diff) | |
download | CMake-bf0c200f0a8f494f3e78465ab8be0763ecdcbb6d.zip CMake-bf0c200f0a8f494f3e78465ab8be0763ecdcbb6d.tar.gz CMake-bf0c200f0a8f494f3e78465ab8be0763ecdcbb6d.tar.bz2 |
ENH: Added cmTarget::GetLanguages method to centralize computation of the list of languages compiled in a target. Transformed NeedRequiresStep to use it.
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 22 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.h | 2 |
2 files changed, 11 insertions, 13 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 6945b0d..922cdb7 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -731,8 +731,7 @@ cmGlobalUnixMakefileGenerator3 makefileName = localName; makefileName += "/build.make"; - bool needRequiresStep = - this->NeedRequiresStep(lg,t->second.GetName()); + bool needRequiresStep = this->NeedRequiresStep(t->second); lg->WriteDivider(ruleFileStream); ruleFileStream @@ -1168,18 +1167,17 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule bool cmGlobalUnixMakefileGenerator3 -::NeedRequiresStep(cmLocalUnixMakefileGenerator3 *lg,const char *name) +::NeedRequiresStep(cmTarget const& target) { - std::map<cmStdString,cmLocalUnixMakefileGenerator3::IntegrityCheckSet>& - checkSet = lg->GetIntegrityCheckSet()[name]; - for(std::map<cmStdString, - cmLocalUnixMakefileGenerator3::IntegrityCheckSet>::const_iterator - l = checkSet.begin(); l != checkSet.end(); ++l) + std::set<cmStdString> languages; + target.GetLanguages(languages); + for(std::set<cmStdString>::const_iterator l = languages.begin(); + l != languages.end(); ++l) { - std::string name2 = "CMAKE_NEEDS_REQUIRES_STEP_"; - name2 += l->first; - name2 += "_FLAG"; - if(lg->GetMakefile()->GetDefinition(name2.c_str())) + std::string var = "CMAKE_NEEDS_REQUIRES_STEP_"; + var += *l; + var += "_FLAG"; + if(target.GetMakefile()->GetDefinition(var.c_str())) { return true; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 512618e..56c4994 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -165,7 +165,7 @@ protected: cmTarget &target); // 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 virtual const char* GetAllTargetName() { return "all"; } |