D: Fix linking errors with static D libraries on Windows

pull/4120/head
GoaLitiuM 6 years ago committed by Jussi Pakkanen
parent a45be05a7e
commit 289c1bf919
  1. 11
      mesonbuild/compilers/d.py

@ -489,6 +489,17 @@ class DmdDCompiler(DCompiler):
return self.get_target_arch_args() + d_dmd_buildtype_args[buildtype]
return d_dmd_buildtype_args[buildtype]
def get_std_exe_link_args(self):
if is_windows():
# DMD links against D runtime only when main symbol is found,
# so these needs to be inserted when linking static D libraries.
if self.is_64:
return ['phobos64.lib']
elif self.is_msvc:
return ['phobos32mscoff.lib']
return ['phobos.lib']
return []
def get_std_shared_lib_link_args(self):
return ['-shared', '-defaultlib=libphobos2.so']

Loading…
Cancel
Save