From 57e01c2964eec589686f8ebfeba4a78d26364e98 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 19 Mar 2016 04:35:47 +0530 Subject: [PATCH] compilers: While linking, filter out libraries that are bundled with the MSVC runtime --- mesonbuild/compilers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 5461d07f3..cc554c4e9 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -1220,7 +1220,13 @@ class VisualStudioCCompiler(CCompiler): i = '/LIBPATH:' + i[2:] # Translate GNU-style -lfoo library name to the import library if i.startswith('-l'): - i = i[2:] + '.lib' + name = i[2:] + if name in ('m', 'c'): + # With MSVC, these are provided by the C runtime which is + # linked in by default + continue + else: + i = name + '.lib' result.append(i) return result