summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-08-02 18:23:46 (GMT)
committerBrad King <brad.king@kitware.com>2007-08-02 18:23:46 (GMT)
commit8b0575c4ceff0373cf9c014800276cba4db94fe2 (patch)
tree405b0ca8e796fc4c6f68bf27889fbb2ab9265cb6 /Source
parent9f2de08f909350da3ebc14f124051a59ed1947c3 (diff)
downloadCMake-8b0575c4ceff0373cf9c014800276cba4db94fe2.zip
CMake-8b0575c4ceff0373cf9c014800276cba4db94fe2.tar.gz
CMake-8b0575c4ceff0373cf9c014800276cba4db94fe2.tar.bz2
ENH: Added cmTarget::GetLanguages method to centralize computation of the list of languages compiled in a target.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx24
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h2
2 files changed, 12 insertions, 14 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 6945b0d..8d528a4 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
@@ -851,7 +850,7 @@ cmGlobalUnixMakefileGenerator3
t->second.GetName(), depends, commands, true);
// Add rules to prepare the target for installation.
- if(t->second.NeedRelinkBeforeInstall())
+ if(!exclude && t->second.NeedRelinkBeforeInstall())
{
localName = lg->GetRelativeTargetDirectory(t->second);
localName += "/preinstall";
@@ -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"; }