From d95a1085031fd1deb24e8f3232e9052e598b2b4e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 13 Feb 2016 05:20:04 +0530 Subject: [PATCH] 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. --- mesonbuild/compilers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index a32034309..3d2f2b3ce 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