From: Mikko Rasa Date: Thu, 9 May 2013 08:19:37 +0000 (+0300) Subject: Include architecture in Binary build signature X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=43d1143e6dc6bbf3797dbaae42d4bfce3dea5d88;p=builder.git Include architecture in Binary build signature This reduces problems if the same source directory is shared between computers of different architectures, or if building versions for different CPUs. --- diff --git a/source/binary.cpp b/source/binary.cpp index e7b5e81..a3f3c9b 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -81,10 +81,12 @@ string Binary::create_build_signature() const 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(); + 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(), ";"); } diff --git a/source/tool.h b/source/tool.h index 042199e..be3646c 100644 --- a/source/tool.h +++ b/source/tool.h @@ -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; }