X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinary.cpp;h=d56ab17b0b59020ae30dc2825654d6c186b485b9;hb=82ae60a647ebb9567f7177c353245f4d72faaf5e;hp=6fd6161989f24450ca4352b60126f474d545f366;hpb=69cdee2c53972c1dd7e1b9d83ddcd8f6c3c589f7;p=builder.git diff --git a/source/binary.cpp b/source/binary.cpp index 6fd6161..d56ab17 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "binary.h" #include "builder.h" #include "component.h" @@ -7,6 +8,7 @@ #include "sharedlibrary.h" #include "sourcepackage.h" #include "staticlibrary.h" +#include "tool.h" using namespace std; using namespace Msp; @@ -16,10 +18,11 @@ Binary::Binary(Builder &b, const FS::Path &p): { } Binary::Binary(Builder &b, const Component &c, const string &p, const list &objs): - FileTarget(b, c.get_package(), c.get_package().get_out_dir()/p) + FileTarget(b, c.get_package(), c.get_package().get_out_dir()/p), + objects(objs) { component = &c; - for(list::const_iterator i=objs.begin(); i!=objs.end(); ++i) + for(list::const_iterator i=objects.begin(); i!=objects.end(); ++i) add_dependency(**i); } @@ -67,3 +70,18 @@ void Binary::find_dependencies() add_dependency(**i); } } + +string Binary::create_build_signature() const +{ + set object_tools; + for(list::const_iterator i=objects.begin(); i!=objects.end(); ++i) + object_tools.insert((*i)->get_tool()); + + list sigs; + sigs.push_back(tool->create_build_signature(component->get_build_info())); + for(set::const_iterator i=object_tools.begin(); i!=object_tools.end(); ++i) + sigs.push_back((*i)->create_build_signature(component->get_build_info())); + sigs.sort(); + + return join(sigs.begin(), sigs.end(), ";"); +}