]> git.tdb.fi Git - builder.git/blob - source/gnucxxcompiler.cpp
87fe1642801fbd466f92474fb9e69d25f76c1fae
[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                 const FS::Path &sysroot = build_info.sysroot;
33                 FS::Path cxx_path = sysroot/"usr"/"include"/"c++"/version;
34                 if(FS::is_dir(cxx_path))
35                         system_path.push_back(cxx_path);
36         }
37 }