From 644809fe59f331a7143587b9b71ad3c514cbb59b Mon Sep 17 00:00:00 2001 From: GoaLitiuM Date: Thu, 6 Sep 2018 04:52:09 +0300 Subject: Make sure static library files are passed properly to the linker --- mesonbuild/compilers/d.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mesonbuild/compilers/d.py') diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index 6801db7..5433b36 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -328,6 +328,17 @@ class DCompiler(Compiler): # compiler (pass flag through to the linker) # Hence, we guess here whether the flag was intended to pass # a linker search path. + + # Make sure static library files are passed properly to the linker. + if arg.endswith('.a') or arg.endswith('.lib'): + if arg.startswith('-L='): + farg = arg[3:] + else: + farg = arg[2:] + if len(farg) > 0 and not farg.startswith('-'): + dcargs.append('-L=' + farg) + continue + dcargs.append('-L=' + arg) continue -- cgit v1.1