2 #include <msp/core/maputils.h>
9 Toolchain::~Toolchain()
11 for(const auto &kvp: tools)
13 for(Toolchain *c: chains)
17 void Toolchain::add_tool(Tool *tool)
19 insert_unique(tools, tool->get_tag(), tool);
22 void Toolchain::add_toolchain(Toolchain *chain)
24 chains.push_back(chain);
27 bool Toolchain::has_tool(const string &tag) const
31 return any_of(chains.begin(), chains.end(), [&tag](Toolchain *tc){ return tc->has_tool(tag); });
34 Tool &Toolchain::get_tool(const string &tag) const
38 for(const Toolchain *c: chains)
40 return c->get_tool(tag);
43 return *get_item(tools, tag);
46 Tool *Toolchain::get_tool_for_suffix(const string &suffix, bool aux) const
48 for(const auto &kvp: tools)
49 if(kvp.second->accepts_suffix(suffix, aux))
52 for(const Toolchain *c: chains)
53 if(Tool *tool = c->get_tool_for_suffix(suffix, aux))