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.
pull/404/head
Nirbheek Chauhan 9 years ago committed by Jussi Pakkanen
parent 560d9d7375
commit d95a108503
  1. 3
      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

Loading…
Cancel
Save