]> git.tdb.fi Git - builder.git/blobdiff - source/binarypackage.cpp
Refactor logger to do message formatting internally
[builder.git] / source / binarypackage.cpp
index 2c32d87769a76a48f7ce9a2bb2a5414486b42ff3..adfca1a273bd4ae86b1296e23225918000f0c6cd 100644 (file)
@@ -1,4 +1,4 @@
-#include <algorithm>
+#include <msp/core/algorithm.h>
 #include <msp/io/print.h>
 #include <msp/strings/utils.h>
 #include "binarypackage.h"
@@ -24,7 +24,7 @@ BinaryPackage *BinaryPackage::from_flags(Builder &builder, const string &name, c
 
        Flags exclusive_static_flags;
        for(const string &f: static_flags)
-               if(find(flags.begin(), flags.end(), f)==flags.end())
+               if(!any_equals(flags, f))
                        exclusive_static_flags.push_back(f);
        process_flags(exclusive_static_flags, pkg->static_binfo);
 
@@ -60,7 +60,7 @@ void BinaryPackage::do_prepare()
        bool has_relative_paths = any_of(export_binfo.libpath.begin(), export_binfo.libpath.end(), is_relative) ||
                any_of(export_binfo.incpath.begin(), export_binfo.incpath.end(), is_relative);
 
-       list<FS::Path> bases;
+       vector<FS::Path> bases;
 
        /* If we have any relative paths that need resolving, or we have no paths at
        all and are not using pkg-config, look for files in prefix */
@@ -83,7 +83,7 @@ void BinaryPackage::do_prepare()
                                prefix /= arch.get_cross_prefix();
                }
 
-               BuildInfo::PathList libpath = export_binfo.libpath;
+               VirtualFileSystem::SearchPath libpath = export_binfo.libpath;
                if(!system && libpath.empty())
                        libpath.push_back("lib");
                for(FS::Path &p: libpath)
@@ -93,7 +93,7 @@ void BinaryPackage::do_prepare()
                for(const string &l: export_binfo.libs)
                        all_found &= (builder.get_vfs().find_library(l, libpath, export_binfo.libmode, system)!=0);
 
-               BuildInfo::PathList incpath = export_binfo.incpath;
+               VirtualFileSystem::SearchPath incpath = export_binfo.incpath;
                if(!system && incpath.empty())
                        incpath.push_back("include");
                for(FS::Path &p: incpath)
@@ -105,7 +105,7 @@ void BinaryPackage::do_prepare()
                if(all_found)
                {
                        base_path = prefix;
-                       builder.get_logger().log("configure", format("%s found in %s", name, ((system && use_pkgconfig) ? "system" : base_path.str())));
+                       builder.get_logger().log("configure", "%s found in %s", name, ((system && use_pkgconfig) ? "system" : base_path.str()));
                        break;
                }
        }
@@ -113,7 +113,7 @@ void BinaryPackage::do_prepare()
        if(base_path.empty())
        {
                // TODO report which files were not found
-               builder.get_logger().log("problems", format("Cannot locate files for %s", name));
+               builder.get_logger().log("problems", "Cannot locate files for %s", name);
                problems.push_back("Cannot locate files");
                return;
        }
@@ -135,7 +135,7 @@ void BinaryPackage::do_prepare()
 
        if(!static_binfo.libs.empty())
        {
-               BuildInfo::PathList combined_libpath = static_binfo.libpath;
+               VirtualFileSystem::SearchPath combined_libpath = static_binfo.libpath;
                combined_libpath.insert(combined_libpath.end(), export_binfo.libpath.begin(), export_binfo.libpath.end());
 
                for(const string &l: export_binfo.libs)