X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgnucompiler.cpp;h=6989e2d3a40e3af4fdc7cffacb07c57bdbe0ec4d;hb=1d687970cc35e54c3335f4aa2fdef23424fe0a06;hp=4fa293b1b650153024e5601d86043e62115e9591;hpb=45c778b1976de1a3093e0c6fb5e2a94c42073dcb;p=builder.git diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index 4fa293b..6989e2d 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -1,6 +1,7 @@ #include #include #include +#include "architecture.h" #include "builder.h" #include "component.h" #include "externaltask.h" @@ -15,11 +16,12 @@ using namespace Msp; GnuCompiler::GnuCompiler(Builder &b, const string &t, const string &n): Tool(b, t), name(n) -{ } - -Target *GnuCompiler::create_source(const Component &comp, const FS::Path &path) const { - return new SourceFile(builder, comp, path); + const Architecture &arch = builder.get_current_arch(); + if(arch.is_native()) + system_path.push_back("/usr/include"); + else + system_path.push_back("/usr/"+arch.get_cross_prefix()+"/include"); } Target *GnuCompiler::create_target(const list &sources, const std::string &) const @@ -37,7 +39,7 @@ Task *GnuCompiler::run(const Target &target) const const ObjectFile &object = dynamic_cast(target); const Component &comp = object.get_component(); - vector argv; + ExternalTask::Arguments argv; argv.push_back(name); argv.push_back("-c");