void Component::create_build_info()
{
+ BuildInfo final_build_info;
+
const PackageList &pkg_reqs = package.get_required_packages();
PackageList direct_reqs = requires;
direct_reqs.insert(direct_reqs.end(), pkg_reqs.begin(), pkg_reqs.end());
BuildInfo::UpdateLevel level = BuildInfo::CHAINED;
if(find(direct_reqs.begin(), direct_reqs.end(), *i)!=direct_reqs.end())
level = BuildInfo::DEPENDENCY;
- build_info.update_from((*i)->get_exported_build_info(), level);
+ final_build_info.update_from((*i)->get_exported_build_info(), level);
const PackageList &reqs = (*i)->get_required_packages();
for(PackageList::const_iterator j=reqs.begin(); j!=reqs.end(); ++j)
all_reqs.push_back(*j);
}
- build_info.update_from(package.get_build_info());
+ final_build_info.update_from(package.get_build_info());
for(BuildInfo::PathList::iterator i=build_info.incpath.begin(); i!=build_info.incpath.end(); ++i)
*i = (package.get_source_directory() / *i).str();
for(BuildInfo::PathList::iterator i=build_info.libpath.begin(); i!=build_info.libpath.end(); ++i)
*i = (package.get_source_directory() / *i).str();
+ final_build_info.update_from(build_info);
+ build_info = final_build_info;
+
if(type==LIBRARY || type==MODULE)
if(build_info.libmode<BuildInfo::DYNAMIC)
build_info.libmode = BuildInfo::DYNAMIC;
void SourcePackage::create_build_info()
{
+ BuildInfo final_build_info;
+
if(build_type)
- build_info.update_from(build_type->get_build_info());
+ final_build_info.update_from(build_type->get_build_info());
+
+ final_build_info.update_from(build_info);
+ build_info = final_build_info;
build_info.incpath.push_back((builder.get_prefix()/"include").str());
build_info.libpath.push_back((builder.get_prefix()/"lib").str());
- bool export_paths = false;
- for(ComponentList::const_iterator i=components.begin(); (!export_paths && i!=components.end()); ++i)
- export_paths = (i->get_type()==Component::LIBRARY);
-
- if(export_paths)
- {
- export_binfo.incpath.push_back((builder.get_prefix()/"include").str());
- export_binfo.libpath.push_back((builder.get_prefix()/"lib").str());
- }
-
for(FeatureList::iterator i=features.begin(); i!=features.end(); ++i)
if(lexical_cast<bool>(config.get_option("with_"+i->name).value))
build_info.defines["WITH_"+toupper(i->name)] = "1";
+ bool export_paths = false;
for(list<Component>::iterator i=components.begin(); i!=components.end(); ++i)
{
i->prepare();
i->create_build_info();
+
if(i->get_type()==Component::LIBRARY)
+ {
export_binfo.libs.push_back(i->get_name());
+ export_paths = true;
+ }
+ }
+
+ if(export_paths)
+ {
+ export_binfo.incpath.push_back((builder.get_prefix()/"include").str());
+ export_binfo.libpath.push_back((builder.get_prefix()/"lib").str());
}
}