ENH: only add _LIB_DEPEND information for libraries and modules
This commit is contained in:
parent
993aebb748
commit
e5668ea656
@ -659,6 +659,14 @@ void cmMakefile::SetProjectName(const char* p)
|
|||||||
|
|
||||||
void cmMakefile::AddGlobalLinkInformation(const char* name, cmTarget& target)
|
void cmMakefile::AddGlobalLinkInformation(const char* name, cmTarget& target)
|
||||||
{
|
{
|
||||||
|
// for these targets do not add anything
|
||||||
|
switch(target.GetType())
|
||||||
|
{
|
||||||
|
case cmTarget::UTILITY:
|
||||||
|
case cmTarget::INSTALL_FILES:
|
||||||
|
case cmTarget::INSTALL_PROGRAMS:
|
||||||
|
return;
|
||||||
|
}
|
||||||
std::vector<std::string>::iterator j;
|
std::vector<std::string>::iterator j;
|
||||||
for(j = m_LinkDirectories.begin();
|
for(j = m_LinkDirectories.begin();
|
||||||
j != m_LinkDirectories.end(); ++j)
|
j != m_LinkDirectories.end(); ++j)
|
||||||
@ -766,7 +774,6 @@ void cmMakefile::AddExecutable(const char *exeName,
|
|||||||
target.SetInAll(true);
|
target.SetInAll(true);
|
||||||
target.GetSourceLists() = srcs;
|
target.GetSourceLists() = srcs;
|
||||||
this->AddGlobalLinkInformation(exeName, target);
|
this->AddGlobalLinkInformation(exeName, target);
|
||||||
|
|
||||||
m_Targets.insert(cmTargets::value_type(exeName,target));
|
m_Targets.insert(cmTargets::value_type(exeName,target));
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,6 +134,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
|||||||
// simply a set of libraries separated by ";". There should always
|
// simply a set of libraries separated by ";". There should always
|
||||||
// be a trailing ";". These library names are not canonical, in that
|
// be a trailing ";". These library names are not canonical, in that
|
||||||
// they may be "-framework x", "-ly", "/path/libz.a", etc.
|
// they may be "-framework x", "-ly", "/path/libz.a", etc.
|
||||||
|
// only add depend information for library targets
|
||||||
|
if(m_TargetType >= STATIC_LIBRARY && m_TargetType <= MODULE_LIBRARY)
|
||||||
|
{
|
||||||
std::string targetEntry = target;
|
std::string targetEntry = target;
|
||||||
targetEntry += "_LIB_DEPENDS";
|
targetEntry += "_LIB_DEPENDS";
|
||||||
std::string dependencies;
|
std::string dependencies;
|
||||||
@ -148,7 +151,10 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
|||||||
dependencies += ";";
|
dependencies += ";";
|
||||||
}
|
}
|
||||||
mf.AddCacheDefinition( targetEntry.c_str(), dependencies.c_str(),
|
mf.AddCacheDefinition( targetEntry.c_str(), dependencies.c_str(),
|
||||||
"Dependencies for the target", cmCacheManager::STATIC );
|
"Dependencies for the target",
|
||||||
|
cmCacheManager::STATIC );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmTarget::HasCxx() const
|
bool cmTarget::HasCxx() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user