}
-void BuildInfo::update_from(const BuildInfo &bi)
+void BuildInfo::update_from(const BuildInfo &bi, UpdateLevel level)
{
cflags.insert(cflags.end(), bi.cflags.begin(), bi.cflags.end());
defines.insert(defines.end(), bi.defines.begin(), bi.defines.end());
incpath.insert(incpath.end(), bi.incpath.begin(), bi.incpath.end());
- ldflags.insert(ldflags.end(), bi.ldflags.begin(), bi.ldflags.end());
- libpath.insert(libpath.end(), bi.libpath.begin(), bi.libpath.end());
- libs.insert(libs.end(), bi.libs.begin(), bi.libs.end());
+ if(level!=CHAINED)
+ {
+ ldflags.insert(ldflags.end(), bi.ldflags.begin(), bi.ldflags.end());
+ libpath.insert(libpath.end(), bi.libpath.begin(), bi.libpath.end());
+ libs.insert(libs.end(), bi.libs.begin(), bi.libs.end());
+ }
warnings.insert(warnings.end(), bi.warnings.begin(), bi.warnings.end());
}
void warning(const std::string &);
};
+ enum UpdateLevel
+ {
+ LOCAL,
+ DEPENDENCY,
+ CHAINED
+ };
+
StringList cflags;
StringList defines;
StringList incpath;
StringList warnings;
/** Adds another BuildInfo to the end of this one. */
- void update_from(const BuildInfo &);
+ void update_from(const BuildInfo &, UpdateLevel = LOCAL);
/** Makes sure there are no duplicate entries in the lists. For warnings,
contradicting flags are eliminated and the last one stays in effect. */
PackageList all_reqs = direct_reqs;
for(PackageList::iterator i=all_reqs.begin(); i!=all_reqs.end(); ++i)
{
+ BuildInfo::UpdateLevel level = BuildInfo::CHAINED;
if(find(direct_reqs.begin(), direct_reqs.end(), *i)!=direct_reqs.end())
- build_info.update_from((*i)->get_exported_binfo());
- else
- {
- const BuildInfo &ebi = (*i)->get_exported_binfo();
- build_info.cflags.insert(build_info.cflags.end(), ebi.cflags.begin(), ebi.cflags.end());
- build_info.incpath.insert(build_info.incpath.end(), ebi.incpath.begin(), ebi.incpath.end());
- build_info.defines.insert(build_info.defines.end(), ebi.defines.begin(), ebi.defines.end());
- }
+ level = BuildInfo::DEPENDENCY;
+ build_info.update_from((*i)->get_exported_binfo(), level);
const PackageList &reqs = (*i)->get_requires();
for(PackageList::const_iterator j=reqs.begin(); j!=reqs.end(); ++j)