]> git.tdb.fi Git - builder.git/blobdiff - source/virtualfilesystem.cpp
Library search fixes
[builder.git] / source / virtualfilesystem.cpp
index 19bc8db6fe2e4cf0ef24255ccd02bef5b5d7fbca..f1a0adb7b633c78a6b16896be775a65ba5f497fd 100644 (file)
@@ -96,17 +96,19 @@ FileTarget *VirtualFileSystem::find_library(const string &lib, const SearchPath
                        FS::Path filename = *i / *j;
                        if(FileTarget *tgt = get_target(filename))
                        {
-                               if(cur_names!=&shared_names || mode==BuildInfo::DYNAMIC)
-                               {
-                                       builder.get_logger().log("vfs", format("Library %s (%s) found in %s as existing %s", lib, *j, i->str(), tgt->get_type()));
-                                       return tgt;
-                               }
+                               builder.get_logger().log("vfs", format("Library %s (%s) found in %s as existing %s", lib, *j, i->str(), tgt->get_type()));
+                               return tgt;
                        }
                        else if(file_exists(filename))
                        {
                                builder.get_logger().log("vfs", format("Library %s (%s) found in %s", lib, *j, i->str()));
                                if(cur_names==&shared_names)
+                               {
+                                       // XXX Hack: create StaticLibrary targets for import libraries
+                                       if(FS::extpart(*j)==".a")
+                                               return new StaticLibrary(builder, filename);
                                        return new SharedLibrary(builder, filename);
+                               }
                                else
                                        return new StaticLibrary(builder, filename);
                        }