diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-09-25 11:13:32 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-09-27 00:27:38 +0530 |
commit | a0551d7d6ec3f7c6aa85edbcb00ae79f4a97865f (patch) | |
tree | 1dcaf852210cc61e31ed506f191f0c3e07b6747c | |
parent | c9a7422cc1389c1ec51df34d8f96b83aeaf8b509 (diff) | |
download | meson-a0551d7d6ec3f7c6aa85edbcb00ae79f4a97865f.zip meson-a0551d7d6ec3f7c6aa85edbcb00ae79f4a97865f.tar.gz meson-a0551d7d6ec3f7c6aa85edbcb00ae79f4a97865f.tar.bz2 |
dependencies/boost: Fix 32-bit vs 64-bit on Windows
Fixes https://github.com/mesonbuild/meson/issues/526
Also removes useless and incorrect mesonlib.is_32bit() function. We
cannot trust that the architecture that Python is built for is the same
as the one we're targetting.
-rw-r--r-- | mesonbuild/dependencies.py | 17 | ||||
-rw-r--r-- | mesonbuild/mesonlib.py | 3 |
2 files changed, 14 insertions, 6 deletions
diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py index f32e7ff..1b9e6f4 100644 --- a/mesonbuild/dependencies.py +++ b/mesonbuild/dependencies.py @@ -25,6 +25,7 @@ import sysconfig from . mesonlib import MesonException from . import mlog from . import mesonlib +from .environment import detect_cpu_family class DependencyException(MesonException): def __init__(self, *args, **kwargs): @@ -582,11 +583,21 @@ class BoostDependency(Dependency): return self.detect_lib_modules_nix() def detect_lib_modules_win(self): - if mesonlib.is_32bit(): + arch = detect_cpu_family(self.environment.coredata.compilers) + # Guess the libdir + if arch == 'x86': gl = 'lib32*' - else: + elif arch == 'x86_64': gl = 'lib64*' - libdir = glob.glob(os.path.join(self.boost_root, gl)) + else: + # Does anyone do Boost cross-compiling to other archs on Windows? + gl = None + # See if the libdir is valid + if gl: + libdir = glob.glob(os.path.join(self.boost_root, gl)) + else: + libdir = [] + # Can't find libdir, bail if len(libdir) == 0: return libdir = libdir[0] diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 7294a54..abb5641 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -91,9 +91,6 @@ def is_windows(): platname = platform.system().lower() return platname == 'windows' or 'mingw' in platname -def is_32bit(): - return not(sys.maxsize > 2**32) - def is_debianlike(): return os.path.isfile('/etc/debian_version') |