ENH: Make the LinkLibraries command contribute dependencies towards AddLibraries.

This commit is contained in:
Amitha Perera
2002-05-01 16:33:27 -04:00
parent 36f80fe6c8
commit 099436db26
6 changed files with 62 additions and 29 deletions

View File

@@ -33,7 +33,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
std::vector<std::string>::const_iterator s = args.begin();
std::string libname = *s;
m_LibName = *s;
++s;
@@ -67,8 +67,18 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
++s;
}
m_Makefile->AddLibrary(libname.c_str(), shared, srclists);
m_Makefile->AddLibrary(m_LibName.c_str(), shared, srclists);
return true;
}
void cmAddLibraryCommand::FinalPass()
{
const cmTarget::LinkLibraries& libs = m_Makefile->GetLinkLibraries();
for( cmTarget::LinkLibraries::const_iterator i = libs.begin();
i != libs.end(); ++i )
{
m_Makefile->AddDependencyToCache( m_LibName.c_str(), i->first );
}
}