Use include path from component instead of package when resolving ObjectFile dependencies
install(false)
{ }
+void Component::resolve_refs()
+{
+ for(list<PackageRef>::iterator i=requires.begin(); i!=requires.end(); ++i)
+ i->resolve();
+}
+
void Component::create_build_info()
{
build_info.add(pkg.get_build_info());
+
+ for(list<PackageRef>::iterator i=requires.begin(); i!=requires.end(); ++i)
+ {
+ if(!i->get_package())
+ continue;
+ i->get_package()->create_build_info();
+ build_info.add(i->get_package()->get_exported_binfo());
+ }
+
build_info.unique();
}
add("install", &Component::install);
add("install_headers", &Component::install_headers);
add("build_info", &Loader::build_info);
+ add("require", &Loader::require);
}
void Component::Loader::source(const string &s)
comp.sources.push_back(comp.pkg.get_source()/s);
}
+void Component::Loader::require(const string &n)
+{
+ comp.requires.push_back(PackageRef(comp.pkg.get_builder(), n));
+}
+
void Component::Loader::build_info()
{
load_sub(comp.build_info);
#include <msp/path/path.h>
#include "buildinfo.h"
#include "misc.h"
+#include "packageref.h"
class Package;
Component ∁
void source(const std::string &);
+ void require(const std::string &);
void build_info();
};
const BuildInfo &get_build_info() const { return build_info; }
bool get_install() const { return install; }
const std::string &get_install_headers() const { return install_headers; }
+ void resolve_refs();
void create_build_info();
protected:
Package &pkg;
bool install;
std::string install_headers;
BuildInfo build_info;
+ std::list<PackageRef> requires;
};
typedef std::list<Component> ComponentList;
const list<string> &includes=src->get_includes();
for(list<string>::const_iterator i=includes.begin(); i!=includes.end(); ++i)
{
- Target *hdr2=builder.get_header(*i, path, package->get_build_info().incpath);
+ Target *hdr2=builder.get_header(*i, path, comp.get_build_info().incpath);
if(hdr2 && !contains(depends, hdr2))
add_depend(hdr2);
}
{
for(list<PackageRef>::iterator i=requires.begin(); i!=requires.end(); ++i)
i->resolve();
+ for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i)
+ i->resolve_refs();
}
void Package::create_build_info()
const std::list<PackageRef> &get_requires() const { return requires; }
const BuildInfo &get_build_info() const { return build_info; }
const BuildInfo &get_exported_binfo() const { return export_binfo; }
+ Builder &get_builder() const { return builder; }
void resolve_refs();
void create_build_info();
void process_options(const RawOptionMap &);