libpath "@/api/lib";
library "fmodex";
};
- need_path true;
};
binary_package "xlib"
using namespace Msp;
BinaryPackage::BinaryPackage(Builder &b, const string &n):
- Package(b, n),
- need_path(false)
+ Package(b, n)
{
use_pkgconfig = false;
}
-void BinaryPackage::set_path(const FS::Path &p)
-{
- path = builder.get_cwd()/p;
-}
-
void BinaryPackage::create_build_info()
{
for(BuildInfo::PathList::iterator i=export_binfo.incpath.begin(); i!=export_binfo.incpath.end(); ++i)
if((*i)[0]=="@")
- *i = path/i->subpath(1);
+ *i = builder.get_prefix()/i->subpath(1);
for(BuildInfo::PathList::iterator i=export_binfo.libpath.begin(); i!=export_binfo.libpath.end(); ++i)
if((*i)[0]=="@")
- *i = path/i->subpath(1);
+ *i = builder.get_prefix()/i->subpath(1);
}
BinaryPackage *BinaryPackage::from_flags(Builder &builder, const string &name, const vector<string> &flags)
BinaryPackage::Loader::Loader(BinaryPackage &p):
DataFile::DerivedObjectLoader<BinaryPackage, Package>(p)
{
- add("need_path", &BinaryPackage::need_path);
add("build_info", &Loader::build_info);
}
void build_info();
};
-private:
- bool need_path;
- Msp::FS::Path path;
-
-public:
BinaryPackage(Builder &, const std::string &);
- /**
- Sets the path where the package's files were installed. This is only useful
- if the package doesn't use pkg-config.
- */
- void set_path(const Msp::FS::Path &);
-
- bool get_need_path() const { return need_path; }
-
static BinaryPackage *from_flags(Builder &, const std::string &, const std::vector<std::string> &);
private:
virtual void create_build_info();
config.finish();
- for(PackageList::iterator i=requires.begin(); i!=requires.end(); ++i)
- {
- BinaryPackage *bpkg = dynamic_cast<BinaryPackage *>(*i);
- if(bpkg && bpkg->get_need_path())
- bpkg->set_path(config.get_option(bpkg->get_name()+"_path").value);
- }
-
deps_cache.load();
for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i)
void SourcePackage::init_config()
{
- for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i)
- {
- BinaryPackage *bpkg = dynamic_cast<BinaryPackage *>(*i);
- if(bpkg && bpkg->get_need_path())
- config.add_option(bpkg->get_name()+"_path", "/usr", "Path for "+bpkg->get_name());
- }
}
void SourcePackage::create_build_info()