else if(!clean && !create_makefile)
build = true;
- for(auto i=cmdline_targets.begin(); i!=cmdline_targets.end(); )
- {
- string::size_type equal = i->find('=');
- if(equal!=string::npos)
- {
- cmdline_options.insert({ i->substr(0, equal), i->substr(equal+1) });
- cmdline_targets.erase(i++);
- }
- else
- ++i;
- }
-
if(!work_dir.empty())
FS::chdir(work_dir);
builder.add_default_tools();
const Toolchain &toolchain = builder.get_toolchain();
- for(auto i=cmdline_options.begin(); i!=cmdline_options.end(); )
+ for(auto i=cmdline_targets.begin(); i!=cmdline_targets.end(); )
{
- if(toolchain.has_tool(i->first))
+ string::size_type equal = i->find('=');
+ if(equal!=string::npos)
{
- toolchain.get_tool(i->first).set_command(i->second);
- cmdline_options.erase(i++);
+ string key = i->substr(0, equal);
+ string value = i->substr(equal+1);
+ if(toolchain.has_tool(key))
+ toolchain.get_tool(key).set_command(value);
+ else
+ cmdline_options.insert({ key, value });
+ i = cmdline_targets.erase(i);
}
else
++i;