From: Mikko Rasa Date: Sun, 8 Jul 2012 20:43:53 +0000 (+0300) Subject: It's no longer necessary to store the name in GnuCompiler X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4fea1031bf55f4f4d7f17f529a89aa5945018446;p=builder.git It's no longer necessary to store the name in GnuCompiler --- diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index 87fd662..1180b4e 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -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()) diff --git a/source/gnucompiler.h b/source/gnucompiler.h index 127f32e..d09cb9a 100644 --- a/source/gnucompiler.h +++ b/source/gnucompiler.h @@ -6,8 +6,6 @@ class GnuCompiler: public Tool { protected: - std::string name; - GnuCompiler(Builder &, const std::string &, const std::string &); public: diff --git a/source/gnucxxcompiler.cpp b/source/gnucxxcompiler.cpp index cadd21f..9045b6c 100644 --- a/source/gnucxxcompiler.cpp +++ b/source/gnucxxcompiler.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -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; }