aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-06-18 12:20:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-06-18 12:20:09 +0200
commit0d692ec857340a0f16a03d6a7ef38fe864a83cfc (patch)
treedeb5def2e8742d6ce2015e88483dab2a68dd4b0f
parent8d6c00d45d7815240d6e3a46128737e03ca73c50 (diff)
Fix MinGW .dll.a search
-rw-r--r--build2/cxx/link.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/build2/cxx/link.cxx b/build2/cxx/link.cxx
index 762349b..bbb49ca 100644
--- a/build2/cxx/link.cxx
+++ b/build2/cxx/link.cxx
@@ -318,13 +318,7 @@ namespace build2
sn = path ("lib" + p.name);
if (tsys == "darwin") e = "dylib";
- //
- // @@ Here we are searching for the import library but if it's not
- // found, then we could also search for the DLL since we can link
- // directly to it. Of course, we would also need some way to mark
- // this libso{} as "import-less".
- //
- else if (tsys == "mingw32") e = "dll.a";
+ else if (tsys == "mingw32") e = "dll";
else e = "so";
}
@@ -384,7 +378,20 @@ namespace build2
f = d;
f /= sn;
- if ((mt = file_mtime (f)) != timestamp_nonexistent)
+ // @@ Here we are searching for the import library but if it's not
+ // found, then we could also search for the DLL since we can link
+ // directly to it. Of course, we would also need some way to mark
+ // this libso{} as "import-less".
+ //
+ // @@ This is a bit of hack until we get support for the explicit
+ // import lib specification.
+ //
+ if (tsys == "mingw32")
+ mt = file_mtime (f + ".a");
+ else
+ mt = file_mtime (f);
+
+ if (mt != timestamp_nonexistent)
{
s = &targets.insert<libso> (d, dir_path (), p.name, se, trace);