aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-02-13 05:20:04 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2016-02-21 13:44:43 +0200
commitd95a1085031fd1deb24e8f3232e9052e598b2b4e (patch)
tree5b0c2113365ccb490884e3ed576241e2f98bd33a
parent560d9d73755e02265377706840efc63e50c693b1 (diff)
downloadmeson-d95a1085031fd1deb24e8f3232e9052e598b2b4e.zip
meson-d95a1085031fd1deb24e8f3232e9052e598b2b4e.tar.gz
meson-d95a1085031fd1deb24e8f3232e9052e598b2b4e.tar.bz2
compilers: MSVC does not understand the -lfoo syntax
MSVC requires import libraries called foo.lib for linking to foo.dll, so translate -lfoo to that. If foo.lib doesn't exist, linking will fail as expected.
-rw-r--r--mesonbuild/compilers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index a320343..3d2f2b3 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1183,6 +1183,9 @@ class VisualStudioCCompiler(CCompiler):
for i in args:
if i.startswith('-L'):
i = '/LIBPATH:' + i[2:]
+ # Translate GNU-style -lfoo library name to the import library
+ if i.startswith('-l'):
+ i = i[2:] + '.lib'
result.append(i)
return result