aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies
diff options
context:
space:
mode:
authorGoaLitiuM <goalitium@kapsi.fi>2018-09-04 03:01:53 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-09-05 20:26:51 +0300
commita45be05a7e9a703e55b305632695705f658e21d4 (patch)
treec3040c052871eecb43d68323528cf1299d21d32b /mesonbuild/dependencies
parent5240b26fb868fd91c912c0a6b1aca0b0638d137c (diff)
downloadmeson-a45be05a7e9a703e55b305632695705f658e21d4.zip
meson-a45be05a7e9a703e55b305632695705f658e21d4.tar.gz
meson-a45be05a7e9a703e55b305632695705f658e21d4.tar.bz2
D: Fix dub dependency handling on Windows
Diffstat (limited to 'mesonbuild/dependencies')
-rw-r--r--mesonbuild/dependencies/base.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index b369780..633228c 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -870,8 +870,14 @@ class DubDependency(ExternalDependency):
mlog.debug('Determining dependency {!r} with DUB executable '
'{!r}'.format(name, self.dubbin.get_path()))
+ # we need to know the correct architecture on Windows
+ if self.compiler.is_64:
+ arch = 'x86_64'
+ else:
+ arch = 'x86'
+
# Ask dub for the package
- ret, res = self._call_dubbin(['describe', name])
+ ret, res = self._call_dubbin(['describe', name, '--arch=' + arch])
if ret != 0:
self.is_found = False
@@ -925,15 +931,10 @@ class DubDependency(ExternalDependency):
def add_lib_args(field_name, target):
if field_name in target['buildSettings']:
- if os.name is 'nt':
- for lib in target['buildSettings'][field_name]:
- if lib not in target['buildSettings'][field_name]:
- libs.append(lib)
- # TODO: Use CCompiler.find_library to find the path of the .lib files
- else: # posix and everything else
- for lib in target['buildSettings'][field_name]:
- if lib not in libs:
- libs.append(lib)
+ for lib in target['buildSettings'][field_name]:
+ if lib not in libs:
+ libs.append(lib)
+ if os.name is not 'nt':
pkgdep = PkgConfigDependency(lib, environment, {'required': 'true', 'silent': 'true'})
for arg in pkgdep.get_compile_args():
self.compile_args.append(arg)
@@ -979,7 +980,7 @@ class DubDependency(ExternalDependency):
d_ver = '' # gdc
# Ex.: library-debug-linux.posix-x86_64-ldc_2081-EF934983A3319F8F8FF2F0E107A363BA
- build_name = 'library-{}-{}.{}-{}-{}_{}'.format(j['buildType'], j['platform'][0], j['platform'][1], platform.machine(), comp, d_ver)
+ build_name = 'library-{}-{}-{}-{}_{}'.format(j['buildType'], '.'.join(j['platform']), j['architecture'][0], comp, d_ver)
for entry in os.listdir(os.path.join(module_build_path, '.dub', 'build')):
if entry.startswith(build_name):
for file in os.listdir(os.path.join(module_build_path, '.dub', 'build', entry)):