From 4a1d64cb6cb8c75cf98b6d5bc36c9634abc26f19 Mon Sep 17 00:00:00 2001 From: GoaLitiuM Date: Sat, 18 Aug 2018 14:10:58 +0300 Subject: [PATCH] Fix import libraries and static library naming --- mesonbuild/build.py | 2 +- mesonbuild/compilers/d.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index c1cb8a824..96c64b8fc 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1079,7 +1079,7 @@ You probably should put it in link_with instead.''') ''' linker, _ = self.get_clink_dynamic_linker_and_stdlibs() # Mixing many languages with MSVC is not supported yet so ignore stdlibs. - if linker and linker.get_id() == 'msvc': + if linker and linker.get_id() in ['msvc', 'llvm', 'dmd']: return True return False diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index eafdc2dff..3366b6b61 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -174,6 +174,9 @@ class DCompiler(Compiler): def get_std_exe_link_args(self): return [] + def gen_import_library_args(self, implibname): + return ['-Wl,--out-implib=' + implibname] + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): if is_windows(): return [] @@ -252,6 +255,10 @@ class DCompiler(Compiler): if arg.startswith('-Wl,'): linkargs = arg[arg.index(',') + 1:].split(',') for la in linkargs: + if la.startswith('--out-implib='): + # Import library name for MSVC targets + dcargs.append('-L/IMPLIB:' + la[13:].strip()) + continue dcargs.append('-L' + la.strip()) continue elif arg.startswith('-install-name'):