1 #include <msp/path/utils.h>
10 Compile::Compile(Builder &b, const Path::Path &s, const Path::Path &o, const Component &c):
16 string ext=Path::splitext(source.str()).ext;
18 if(ext==".cpp" || ext==".cc")
21 argv.push_back("g++");
26 argv.push_back("gcc");
30 const BuildInfo &binfo=comp.get_build_info();
31 for(list<string>::const_iterator i=binfo.cflags.begin(); i!=binfo.cflags.end(); ++i)
33 for(list<string>::const_iterator i=binfo.incpath.begin(); i!=binfo.incpath.end(); ++i)
34 argv.push_back("-I"+*i);
35 for(list<string>::const_iterator i=binfo.defines.begin(); i!=binfo.defines.end(); ++i)
36 argv.push_back("-D"+*i);
39 argv.push_back(object.str());
40 argv.push_back(source.str());
42 Path::mkpath(object.subpath(0, object.size()-1), 0755);
44 announce(comp.get_package().get_name(), tool, relative(object.str(), comp.get_package().get_source()).str());