]> git.tdb.fi Git - builder.git/blobdiff - source/gnucompiler.cpp
Don't crash if the executable of a GnuCompiler is not found
[builder.git] / source / gnucompiler.cpp
index 16e7ccac1d88da73a34776e288980b295f4f0747..470934e0fe7e32432f7d9b344690e9bcbd5be047 100644 (file)
@@ -27,7 +27,7 @@ const char *cpus[] =
 
 }
 
-GnuCompiler::GnuCompiler(Builder &b, const Architecture &a, const string &t, const FS::Path &sysroot):
+GnuCompiler::GnuCompiler(Builder &b, const Architecture &a, const string &t):
        Tool(b, a, t)
 {
        if(tag=="CC")
@@ -50,9 +50,6 @@ GnuCompiler::GnuCompiler(Builder &b, const Architecture &a, const string &t, con
                throw invalid_argument("GnuCompiler::GnuCompiler");
 
        set_command((tag=="CXX" ? "g++" : "gcc"), true);
-
-       if(!sysroot.empty())
-               build_info.sysroot = sysroot;
 }
 
 Target *GnuCompiler::create_source(const Component &comp, const FS::Path &path) const
@@ -83,6 +80,9 @@ Target *GnuCompiler::create_target(const list<Target *> &sources, const string &
 
 string GnuCompiler::create_build_signature(const BuildInfo &binfo) const
 {
+       if(!executable)
+               return string();
+
        string result = FS::basename(executable->get_path());
        if(!architecture->get_cpu().empty())
        {