]> git.tdb.fi Git - builder.git/blob - source/gnucxxcompiler.cpp
d1d05d8b80b9ce6b5b1da5a24b8b0491c4f5a899
[builder.git] / source / gnucxxcompiler.cpp
1 #include <msp/fs/stat.h>
2 #include "csourcefile.h"
3 #include "gnucxxcompiler.h"
4
5 using namespace std;
6 using namespace Msp;
7
8 GnuCxxCompiler::GnuCxxCompiler(Builder &b, const Architecture &a, const FS::Path &sysroot):
9         GnuCompiler(b, a, "CXX", sysroot)
10 {
11         set_command("g++", true);
12         input_suffixes.push_back(".cpp");
13         input_suffixes.push_back(".cc");
14         aux_suffixes.push_back(".hpp");
15 }
16
17 Target *GnuCxxCompiler::create_source(const Component &comp, const FS::Path &path) const
18 {
19         return new CSourceFile(builder, comp, path);
20 }
21
22 Target *GnuCxxCompiler::create_source(const FS::Path &path) const
23 {
24         return new CSourceFile(builder, path);
25 }
26
27 void GnuCxxCompiler::do_prepare()
28 {
29         GnuCompiler::do_prepare();
30         if(!version.empty())
31         {
32                 FS::Path cxx_path = FS::Path("/usr/include/c++")/version;
33                 if(FS::is_dir(cxx_path))
34                         system_path.push_back(cxx_path);
35         }
36 }