using namespace Msp;
FileTarget::FileTarget(Builder &b, const Package *p, const FS::Path &a):
- Target(b, make_name(p, a)),
+ Target(b, generate_name(p, a)),
path(a),
size(0)
{
mark_rebuild("Package options changed");
}
-string FileTarget::make_name(const Package *pkg, const FS::Path &pth)
+string FileTarget::generate_name(const Package *pkg, const FS::Path &pth)
{
if(const SourcePackage *spkg = dynamic_cast<const SourcePackage *>(pkg))
{
protected:
virtual void check_rebuild();
private:
- std::string make_name(const Package *, const Msp::FS::Path &);
+ static std::string generate_name(const Package *, const Msp::FS::Path &);
};
#endif
{ }
StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
- FileTarget(b, &c.get_package(), generate_target_path(c))
+ FileTarget(b, &c.get_package(), c.get_package().get_out_dir()/generate_filename(c))
{
component = &c;
for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
install_location = "lib";
}
-Msp::FS::Path StaticLibrary::generate_target_path(const Component &c)
+string StaticLibrary::generate_filename(const Component &comp)
{
- const Architecture &arch = c.get_package().get_builder().get_current_arch();
- return c.get_package().get_out_dir()/
- arch.get_static_library_patterns().front().apply(c.get_name());
+ const Architecture &arch = comp.get_package().get_builder().get_current_arch();
+ return arch.get_static_library_patterns().front().apply(comp.get_name());
}
virtual const char *get_type() const { return "StaticLibrary"; }
private:
- static Msp::FS::Path generate_target_path(const Component &);
+ static std::string generate_filename(const Component &);
};
#endif