]> git.tdb.fi Git - builder.git/blobdiff - source/gnucxxcompiler.cpp
Make VirtualFileSystem able to find binaries
[builder.git] / source / gnucxxcompiler.cpp
index 0601fc29c5f596fbf1a99d1956450ad13ca10abd..cadd21f026989df463412668a672b182d188bf5c 100644 (file)
@@ -1,6 +1,7 @@
 #include <msp/fs/stat.h>
 #include <msp/io/print.h>
 #include <msp/strings/regex.h>
+#include <msp/strings/utils.h>
 #include "builder.h"
 #include "csourcefile.h"
 #include "externaltask.h"
@@ -19,6 +20,7 @@ GnuCxxCompiler::GnuCxxCompiler(Builder &b):
        ExternalTask::Arguments argv;
        argv.push_back(name);
        argv.push_back("--version");
+       builder.get_logger().log("auxcommands", format("Running %s", join(argv.begin(), argv.end())));
        ExternalTask task(argv);
        task.set_stdout(ExternalTask::CAPTURE);
        task.set_stderr(ExternalTask::IGNORE);
@@ -34,8 +36,7 @@ GnuCxxCompiler::GnuCxxCompiler(Builder &b):
                                FS::Path cxx_path = FS::Path("/usr/include/c++")/cxx_ver;
                                if(FS::is_dir(cxx_path))
                                {
-                                       if(builder.get_verbose()>=5)
-                                               IO::print("%s version is %s\n", name, cxx_ver);
+                                       builder.get_logger().log("tools", format("%s version is %s", name, cxx_ver));
                                        system_path.push_back(cxx_path);
                                        break;
                                }
@@ -52,3 +53,8 @@ Target *GnuCxxCompiler::create_source(const Component &comp, const FS::Path &pat
 {
        return new CSourceFile(builder, comp, path);
 }
+
+Target *GnuCxxCompiler::create_source(const FS::Path &path) const
+{
+       return new CSourceFile(builder, path);
+}