1 #include <msp/path/utils.h>
11 Compile::Compile(Builder &b, const Path::Path &s, const Path::Path &o, const Component &c):
17 string ext=Path::splitext(source.str()).ext;
19 if(ext==".cpp" || ext==".cc")
22 argv.push_back("g++");
27 argv.push_back("gcc");
31 const BuildInfo &binfo=comp.get_build_info();
32 for(list<string>::const_iterator i=binfo.cflags.begin(); i!=binfo.cflags.end(); ++i)
34 for(list<string>::const_iterator i=binfo.incpath.begin(); i!=binfo.incpath.end(); ++i)
35 argv.push_back("-I"+*i);
36 for(list<string>::const_iterator i=binfo.defines.begin(); i!=binfo.defines.end(); ++i)
37 argv.push_back("-D"+*i);
40 argv.push_back(object.str());
41 argv.push_back(source.str());
43 if(!builder.get_dry_run())
44 Path::mkpath(object.subpath(0, object.size()-1), 0755);
46 announce(comp.get_package().get_name(), tool, relative(object.str(), comp.get_package().get_source()).str());