From: Mikko Rasa Date: Sun, 6 May 2012 21:06:42 +0000 (+0300) Subject: Unify some aspects of constructor helper functions X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6026d07fec5132c04fa94d61cef2fd59cffeb4b8;p=builder.git Unify some aspects of constructor helper functions --- diff --git a/source/filetarget.cpp b/source/filetarget.cpp index 2a60c29..dd20a0e 100644 --- a/source/filetarget.cpp +++ b/source/filetarget.cpp @@ -10,7 +10,7 @@ using namespace std; 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) { @@ -62,7 +62,7 @@ void FileTarget::check_rebuild() 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(pkg)) { diff --git a/source/filetarget.h b/source/filetarget.h index 4363d5a..32092d0 100644 --- a/source/filetarget.h +++ b/source/filetarget.h @@ -29,7 +29,7 @@ public: 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 diff --git a/source/staticlibrary.cpp b/source/staticlibrary.cpp index f6c8e56..db04f0a 100644 --- a/source/staticlibrary.cpp +++ b/source/staticlibrary.cpp @@ -12,7 +12,7 @@ StaticLibrary::StaticLibrary(Builder &b, const FS::Path &p): { } StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list &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::const_iterator i=objs.begin(); i!=objs.end(); ++i) @@ -21,9 +21,8 @@ StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list