X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgnuarchiver.cpp;h=158a4d4fee9f70c359d4e22ea1c6255aa82c098f;hb=74ea8208bb1aa1d9afc9657a4cdfac6714241887;hp=168a163449e9814e234bf4f1ee1187cc7a0be61a;hpb=69cdee2c53972c1dd7e1b9d83ddcd8f6c3c589f7;p=builder.git diff --git a/source/gnuarchiver.cpp b/source/gnuarchiver.cpp index 168a163..158a4d4 100644 --- a/source/gnuarchiver.cpp +++ b/source/gnuarchiver.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include "builder.h" #include "component.h" @@ -17,15 +16,11 @@ using namespace Msp; GnuArchiver::GnuArchiver(Builder &b, const Architecture &a): Tool(b, a, "AR") { - string command = "ar"; - if(architecture->is_cross()) - command = format("%s-%s", architecture->get_cross_prefix(), command); - executable = builder.get_vfs().find_binary(command); - + set_command("ar", true); input_suffixes.push_back(".o"); } -Target *GnuArchiver::create_target(const list &sources, const string &) const +Target *GnuArchiver::create_target(const list &sources, const string &) { if(sources.empty()) throw invalid_argument("GnuArchiver::create_target"); @@ -45,6 +40,11 @@ Target *GnuArchiver::create_target(const list &sources, const string & return lib; } +string GnuArchiver::create_build_signature(const BuildInfo &) const +{ + return FS::basename(executable->get_path()); +} + Task *GnuArchiver::run(const Target &target) const { const StaticLibrary &lib = dynamic_cast(target); @@ -63,12 +63,5 @@ Task *GnuArchiver::run(const Target &target) const if(ObjectFile *obj = dynamic_cast(*i)) argv.push_back(relative(obj->get_path(), work_dir).str()); - if(!builder.get_dry_run()) - { - FS::mkpath(FS::dirname(lib.get_path()), 0755); - if(FS::exists(lib.get_path())) - FS::unlink(lib.get_path()); - } - return new ExternalTask(argv, work_dir); }