From 5205a4cf05fecb863e257a1529b7ee2cdc3ab013 Mon Sep 17 00:00:00 2001 From: GoaLitiuM Date: Fri, 14 Sep 2018 04:50:52 +0300 Subject: [PATCH] dub: Detect if the missing package was built for wrong architecture --- mesonbuild/dependencies/base.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index abdc39d08..3f1783009 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -905,7 +905,18 @@ class DubDependency(ExternalDependency): self.module_path = self._find_right_lib_path(package['path'], comp, description, True, package['targetFileName']) if not os.path.exists(self.module_path): - mlog.error(mlog.bold(name), 'found but it wasn\'t compiled with', mlog.bold(comp)) + # check if the dependency was built for other archs + archs = [['x86_64'], ['x86'], ['x86', 'x86_mscoff']] + for a in archs: + description_a = copy.deepcopy(description) + description_a['architecture'] = a + arch_module_path = self._find_right_lib_path(package['path'], comp, description_a, True, package['targetFileName']) + if arch_module_path: + mlog.error(mlog.bold(name), "found but it wasn't compiled for", mlog.bold(arch)) + self.is_found = False + return + + mlog.error(mlog.bold(name), "found but it wasn't compiled with", mlog.bold(comp)) self.is_found = False return