From: Mikko Rasa Date: Sun, 5 Oct 2014 11:46:28 +0000 (+0300) Subject: Allow overriding tool commands on the command line X-Git-Url: http://git.tdb.fi/?p=builder.git;a=commitdiff_plain;h=9fe1e6827bba49c102f0186904922ca0a78852c6;hp=aeb23448b5035f4ceb662c487913618d0efff888 Allow overriding tool commands on the command line --- diff --git a/source/buildercli.cpp b/source/buildercli.cpp index c0a4f06..0ce2bdc 100644 --- a/source/buildercli.cpp +++ b/source/buildercli.cpp @@ -8,6 +8,8 @@ #include "buildercli.h" #include "filetarget.h" #include "sourcepackage.h" +#include "tool.h" +#include "toolchain.h" using namespace std; using namespace Msp; @@ -165,6 +167,18 @@ BuilderCLI::BuilderCLI(int argc, char **argv): builder.set_build_type(build_type); builder.add_default_tools(); + + const Toolchain &toolchain = builder.get_toolchain(); + for(Config::InputOptions::iterator i=cmdline_options.begin(); i!=cmdline_options.end(); ) + { + if(toolchain.has_tool(i->first)) + { + toolchain.get_tool(i->first).set_command(i->second); + cmdline_options.erase(i++); + } + else + ++i; + } } BuilderCLI::~BuilderCLI()