]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Make tools capable of reporting a system-wide path used to locate input files
[builder.git] / source / builder.cpp
index ed749f818e464bb7df7ba8d00d44d11e6f16e313..e8f8927d580ea0e2739aadf1bd32b055f420e1a5 100644 (file)
@@ -125,14 +125,6 @@ Builder::Builder(int argc, char **argv):
 
        cwd = FS::getcwd();
 
-       toolchain.add_tool(new GnuCCompiler(*this));
-       toolchain.add_tool(new GnuCxxCompiler(*this));
-       toolchain.add_tool(new GnuLinker(*this));
-       toolchain.add_tool(new GnuArchiver(*this));
-       toolchain.add_tool(new Copy(*this));
-       toolchain.add_tool(new Tar(*this));
-       toolchain.add_tool(new PkgConfigGenerator(*this));
-
        load_build_file((FS::get_sys_data_dir(argv[0], "builder")/"builderrc").str());
        load_build_file((FS::get_user_data_dir("builder")/"rc").str());
 
@@ -151,6 +143,14 @@ Builder::Builder(int argc, char **argv):
                        }
        }
 
+       toolchain.add_tool(new GnuCCompiler(*this));
+       toolchain.add_tool(new GnuCxxCompiler(*this));
+       toolchain.add_tool(new GnuLinker(*this));
+       toolchain.add_tool(new GnuArchiver(*this));
+       toolchain.add_tool(new Copy(*this));
+       toolchain.add_tool(new Tar(*this));
+       toolchain.add_tool(new PkgConfigGenerator(*this));
+
        if(prfx.empty())
        {
                if(current_arch->is_native())
@@ -305,7 +305,7 @@ int Builder::main()
 
 string Builder::run_pkgconfig(const string &pkg, const string &what)
 {
-       vector<string> argv;
+       ExternalTask::Arguments argv;
        argv.push_back("pkg-config");
        if(what=="cflags" || what=="libs")
                argv.push_back("--"+what);
@@ -321,7 +321,7 @@ string Builder::run_pkgconfig(const string &pkg, const string &what)
        if(verbose>=4)
                IO::print("Running %s\n", join(argv.begin(), argv.end()));
 
-       ExternalTask task(argv, FS::Path());
+       ExternalTask task(argv);
        task.set_stdout(ExternalTask::CAPTURE);
        task.set_stderr(ExternalTask::IGNORE);
        task.start();