]> git.tdb.fi Git - builder.git/blobdiff - source/gnuarchiver.cpp
Support source generators that combine multiple files into one
[builder.git] / source / gnuarchiver.cpp
index 7482b0d17caf004d66125f4a82c8c098d0bb2331..170007028a5201f26bf64160402a2bab3f8bebd7 100644 (file)
@@ -1,7 +1,6 @@
 #include <msp/fs/dir.h>
 #include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
-#include <msp/strings/format.h>
 #include <stdexcept>
 #include "builder.h"
 #include "component.h"
@@ -17,7 +16,9 @@ using namespace Msp;
 GnuArchiver::GnuArchiver(Builder &b, const Architecture &a):
        Tool(b, a, "AR")
 {
+       set_command("ar", true);
        input_suffixes.push_back(".o");
+       processing_unit = COMPONENT;
 }
 
 Target *GnuArchiver::create_target(const list<Target *> &sources, const string &)
@@ -40,12 +41,9 @@ Target *GnuArchiver::create_target(const list<Target *> &sources, const string &
        return lib;
 }
 
-void GnuArchiver::do_prepare()
+string GnuArchiver::create_build_signature(const BuildInfo &) const
 {
-       string command = "ar";
-       if(architecture->is_cross())
-               command = format("%s-%s", architecture->get_cross_prefix(), command);
-       executable = builder.get_vfs().find_binary(command);
+       return FS::basename(executable->get_path());
 }
 
 Task *GnuArchiver::run(const Target &target) const