X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flib%2Fstaticlibrary.cpp;fp=source%2Flib%2Fstaticlibrary.cpp;h=039eb8e7e52c117a8e5b3dfa14bbf25b1064ddbd;hb=c8e829c219c65ff8e93b6c7b66212ff0876441c5;hp=0000000000000000000000000000000000000000;hpb=e2c9c3fffcc61a0c102ccf6a7924e2de709092ad;p=builder.git diff --git a/source/lib/staticlibrary.cpp b/source/lib/staticlibrary.cpp new file mode 100644 index 0000000..039eb8e --- /dev/null +++ b/source/lib/staticlibrary.cpp @@ -0,0 +1,42 @@ +#include "builder.h" +#include "component.h" +#include "objectfile.h" +#include "sourcepackage.h" +#include "staticlibrary.h" + +using namespace std; +using namespace Msp; + +StaticLibrary::StaticLibrary(Builder &b, const Component &c, const vector &objs): + FileTarget(b, c.get_package(), c.get_package().get_output_directory()/generate_filename(c)) +{ + component = &c; + for(ObjectFile *o: objs) + add_dependency(*o); + + install_location = "lib"; + nested_build_sig = true; + arch_in_build_sig = true; +} + +string StaticLibrary::generate_filename(const Component &comp) +{ + const Architecture &arch = comp.get_package().get_builder().get_current_arch(); + return arch.create_filename(comp.get_name()); +} + +void StaticLibrary::add_required_library(const string &lib) +{ + build_info.libs.push_back(lib); +} + +void StaticLibrary::add_library_path(const FS::Path &pth) +{ + build_info.libpath.push_back(pth); +} + +void StaticLibrary::collect_build_info(BuildInfo &binfo) const +{ + Target::collect_build_info(binfo); + binfo.update_from(build_info); +}