summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-11-29 10:44:41 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-12-03 10:06:11 +0530
commit45dbc0d30e2447faeb877469c54a47579e56837c (patch)
treeaf4f79040301a3dae5a26b230740cc2bdf3c2ffb
parent390f0b8b522a7c73880349a250400a2802927b66 (diff)
downloadmeson-45dbc0d30e2447faeb877469c54a47579e56837c.tar.gz
find_library: Prefer .dll.a and .lib over .dll for shared
We can't know if the .lib is a static or import library, but that's a problem in general too. The only way to figure out if a specific file is an import or a static library is to dump its symbols and check if it starts with __imp or not. Even then, some libs are hybrid import and static, i.e., they contain references to DLLs for some symbols and also provide implementations for other symbols so this is a difficult problem. Closes https://github.com/mesonbuild/meson/issues/2659
-rw-r--r--mesonbuild/compilers/c.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 317a4d738..2d123142e 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -727,10 +727,12 @@ class CCompiler(Compiler):
if for_darwin(env.is_cross_build(), env):
shlibext = ['dylib']
elif for_windows(env.is_cross_build(), env):
+ # FIXME: .lib files can be import or static so we should read the
+ # file, figure out which one it is, and reject the wrong kind.
if self.id == 'msvc':
shlibext = ['lib']
else:
- shlibext = ['dll', 'dll.a', 'lib']
+ shlibext = ['dll.a', 'lib', 'dll']
# Yep, static libraries can also be foo.lib
stlibext += ['lib']
elif for_cygwin(env.is_cross_build(), env):