From 0d692ec857340a0f16a03d6a7ef38fe864a83cfc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 18 Jun 2016 12:20:09 +0200 Subject: Fix MinGW .dll.a search --- build2/cxx/link.cxx | 23 +++++++++++++++-------- 1 file 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 (d, dir_path (), p.name, se, trace); -- cgit v1.1