aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/d.py
diff options
context:
space:
mode:
authorGoaLitiuM <goalitium@kapsi.fi>2018-09-04 04:12:23 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-09-05 20:27:47 +0300
commit289c1bf91992c167e8ec4292f2584a4add7f5485 (patch)
tree4475869ffecd0348cb6867f78bc54b0792740a34 /mesonbuild/compilers/d.py
parenta45be05a7e9a703e55b305632695705f658e21d4 (diff)
downloadmeson-289c1bf91992c167e8ec4292f2584a4add7f5485.zip
meson-289c1bf91992c167e8ec4292f2584a4add7f5485.tar.gz
meson-289c1bf91992c167e8ec4292f2584a4add7f5485.tar.bz2
D: Fix linking errors with static D libraries on Windows
Diffstat (limited to 'mesonbuild/compilers/d.py')
-rw-r--r--mesonbuild/compilers/d.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index d4ddf15..5beacbd 100644
--- a/mesonbuild/compilers/d.py
+++ b/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']