]> git.tdb.fi Git - builder.git/blobdiff - source/virtualfilesystem.cpp
Convert all list containers to vectors
[builder.git] / source / virtualfilesystem.cpp
index 783583f7798d2f9228b92a954bb93e387b7606cd..2fecdf0fc50c9427fd1d06c194b597b7b41ff864 100644 (file)
@@ -84,7 +84,7 @@ FileTarget *VirtualFileSystem::find_library(const string &lib, const SearchPath
 
        const Architecture &arch = builder.get_current_arch();
 
-       list<string> shared_names;
+       vector<string> shared_names;
        bool use_import_lib = false;
        if(mode!=BuildInfo::FORCE_STATIC)
        {
@@ -93,13 +93,13 @@ FileTarget *VirtualFileSystem::find_library(const string &lib, const SearchPath
                        shared_names = Pattern::apply_list(arch.get_patterns<SharedLibrary>(), lib);
        }
 
-       list<string> static_names;
+       vector<string> static_names;
        if(mode!=BuildInfo::FORCE_DYNAMIC)
                static_names = Pattern::apply_list(arch.get_patterns<StaticLibrary>(), lib);
 
        for(const FS::Path &p: combined_path)
        {
-               const list<string> *cur_names = (mode>=BuildInfo::DYNAMIC ? &shared_names : &static_names);
+               const vector<string> *cur_names = (mode>=BuildInfo::DYNAMIC ? &shared_names : &static_names);
                for(auto j=cur_names->begin(); j!=cur_names->end(); )
                {
                        FS::Path filename = p / *j;
@@ -146,17 +146,21 @@ FileTarget *VirtualFileSystem::find_binary(const string &name)
                path.push_back("/");
        else
        {
-               string env_path = Msp::getenv("PATH");
-               if(!env_path.empty())
+               if(sys_bin_path.empty())
                {
-                       for(const string &p: split(env_path, ':'))
-                               path.push_back(p);
-               }
-               else
-               {
-                       path.push_back("/bin");
-                       path.push_back("/usr/bin");
+                       string env_path = Msp::getenv("PATH");
+                       if(!env_path.empty())
+                       {
+                               for(const string &p: split(env_path, ':'))
+                                       sys_bin_path.push_back(p);
+                       }
+                       else
+                       {
+                               sys_bin_path.push_back("/bin");
+                               sys_bin_path.push_back("/usr/bin");
+                       }
                }
+               path = sys_bin_path;
        }
 
        for(const FS::Path &p: path)