d: Fix linker errors with shared libraries on Windows

pull/5064/head
Ari Vuollet 6 years ago committed by Jussi Pakkanen
parent d4cece3b34
commit 5ee2fb6ede
  1. 2
      ci/install-dmd.ps1
  2. 10
      mesonbuild/compilers/d.py
  3. 2
      run_project_tests.py

@ -9,8 +9,8 @@ $ProgressPreference = "SilentlyContinue"
$dmd_install = "C:\D" $dmd_install = "C:\D"
$dmd_version_file = "C:\cache\DMD_LATEST" $dmd_version_file = "C:\cache\DMD_LATEST"
#echo "Fetching latest DMD version..."
if (!$Version) { if (!$Version) {
#echo "Fetching latest DMD version..."
$dmd_latest_url = "http://downloads.dlang.org/releases/LATEST" $dmd_latest_url = "http://downloads.dlang.org/releases/LATEST"
$retries = 10 $retries = 10
for ($i = 1; $i -le $retries; $i++) { for ($i = 1; $i -le $retries; $i++) {

@ -622,7 +622,15 @@ class DmdDCompiler(DCompiler):
return [] return []
def get_std_shared_lib_link_args(self): def get_std_shared_lib_link_args(self):
return ['-shared', '-defaultlib=libphobos2.so'] libname = 'libphobos2.so'
if is_windows():
if self.arch == 'x86_64':
libname = 'phobos64.lib'
elif self.arch == 'x86_mscoff':
libname = 'phobos32mscoff.lib'
else:
libname = 'phobos.lib'
return ['-shared', '-defaultlib=' + libname]
def get_target_arch_args(self): def get_target_arch_args(self):
# DMD32 and DMD64 on 64-bit Windows defaults to 32-bit (OMF). # DMD32 and DMD64 on 64-bit Windows defaults to 32-bit (OMF).

@ -563,7 +563,7 @@ def detect_tests_to_run():
('C#', 'csharp', skip_csharp(backend)), ('C#', 'csharp', skip_csharp(backend)),
('vala', 'vala', backend is not Backend.ninja or not shutil.which('valac')), ('vala', 'vala', backend is not Backend.ninja or not shutil.which('valac')),
('rust', 'rust', backend is not Backend.ninja or not shutil.which('rustc')), ('rust', 'rust', backend is not Backend.ninja or not shutil.which('rustc')),
('d', 'd', backend is not Backend.ninja or not have_d_compiler() or mesonlib.is_windows()), ('d', 'd', backend is not Backend.ninja or not have_d_compiler()),
('objective c', 'objc', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objc_compiler()), ('objective c', 'objc', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objc_compiler()),
('objective c++', 'objcpp', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objcpp_compiler()), ('objective c++', 'objcpp', backend not in (Backend.ninja, Backend.xcode) or mesonlib.is_windows() or not have_objcpp_compiler()),
('fortran', 'fortran', backend is not Backend.ninja or not shutil.which('gfortran')), ('fortran', 'fortran', backend is not Backend.ninja or not shutil.which('gfortran')),

Loading…
Cancel
Save