From 9fe1e6827bba49c102f0186904922ca0a78852c6 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 5 Oct 2014 14:46:28 +0300 Subject: [PATCH] Allow overriding tool commands on the command line --- source/buildercli.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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() -- 2.45.2