]> git.tdb.fi Git - builder.git/commitdiff
Include architecture in Binary build signature
authorMikko Rasa <tdb@tdb.fi>
Thu, 9 May 2013 08:19:37 +0000 (11:19 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 9 May 2013 08:19:37 +0000 (11:19 +0300)
This reduces problems if the same source directory is shared between
computers of different architectures, or if building versions for
different CPUs.

source/binary.cpp
source/tool.h

index e7b5e818d4e42f3f78272347d1258ec7e883cb49..a3f3c9b4ec71dd4c70439b1150fcb2cd996a8366 100644 (file)
@@ -81,10 +81,12 @@ string Binary::create_build_signature() const
                object_tools.insert((*i)->get_tool());
 
        list<string> sigs;
-       sigs.push_back(tool->create_build_signature(component->get_build_info()));
        for(set<const Tool *>::const_iterator i=object_tools.begin(); i!=object_tools.end(); ++i)
                sigs.push_back((*i)->create_build_signature(component->get_build_info()));
        sigs.sort();
+       sigs.push_front(tool->create_build_signature(component->get_build_info()));
+       if(const Architecture *arch = tool->get_architecture())
+               sigs.push_front(arch->get_name());
 
        return join(sigs.begin(), sigs.end(), ";");
 }
index 042199e54b79342c10e967f7b6de00a6e474554c..be3646cd8f0f674a6022980a1205de5aa5c7b6b9 100644 (file)
@@ -41,6 +41,10 @@ public:
 
        const std::string &get_tag() const { return tag; }
 
+       /** Returns the architecture this tool build for.  May return null if the
+       tool is architecture-agnostic. */
+       const Architecture *get_architecture() const { return architecture; }
+
        /** Returns a target for the tool's own executable.  If the tool does not
        use an external program, returns null. */
        FileTarget *get_executable() const { return executable; }