]> git.tdb.fi Git - builder.git/commitdiff
It's no longer necessary to store the name in GnuCompiler
authorMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2012 20:43:53 +0000 (23:43 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2012 21:08:55 +0000 (00:08 +0300)
source/gnucompiler.cpp
source/gnucompiler.h
source/gnucxxcompiler.cpp

index 87fd6623ee91a58ce606d905a95ee8eace56532e..1180b4e89f1218a5d9f678b4415b3e7bd1c0a398 100644 (file)
@@ -14,10 +14,9 @@ using namespace std;
 using namespace Msp;
 
 GnuCompiler::GnuCompiler(Builder &b, const string &t, const string &n):
-       Tool(b, t),
-       name(n)
+       Tool(b, t)
 {
-       executable = builder.get_vfs().find_binary(name);
+       executable = builder.get_vfs().find_binary(n);
 
        const Architecture &arch = builder.get_current_arch();
        if(arch.is_native())
index 127f32e9bf81b44dfa27aaa2e789d33f7df13b6b..d09cb9ad46b398103826ea8268751622b89189b4 100644 (file)
@@ -6,8 +6,6 @@
 class GnuCompiler: public Tool
 {
 protected:
-       std::string name;
-
        GnuCompiler(Builder &, const std::string &, const std::string &);
 
 public:
index cadd21f026989df463412668a672b182d188bf5c..9045b6c3a369029a48efb39f386ce91a3f4dc978 100644 (file)
@@ -1,4 +1,5 @@
 #include <msp/fs/stat.h>
+#include <msp/fs/utils.h>
 #include <msp/io/print.h>
 #include <msp/strings/regex.h>
 #include <msp/strings/utils.h>
@@ -18,7 +19,7 @@ GnuCxxCompiler::GnuCxxCompiler(Builder &b):
        aux_suffixes.push_back(".hpp");
 
        ExternalTask::Arguments argv;
-       argv.push_back(name);
+       argv.push_back(executable->get_path().str());
        argv.push_back("--version");
        builder.get_logger().log("auxcommands", format("Running %s", join(argv.begin(), argv.end())));
        ExternalTask task(argv);
@@ -36,7 +37,7 @@ GnuCxxCompiler::GnuCxxCompiler(Builder &b):
                                FS::Path cxx_path = FS::Path("/usr/include/c++")/cxx_ver;
                                if(FS::is_dir(cxx_path))
                                {
-                                       builder.get_logger().log("tools", format("%s version is %s", name, cxx_ver));
+                                       builder.get_logger().log("tools", format("%s version is %s", FS::basename(executable->get_path()), cxx_ver));
                                        system_path.push_back(cxx_path);
                                        break;
                                }