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.
pull/814/head
Nirbheek Chauhan 8 years ago
parent c9a7422cc1
commit a0551d7d6e
  1. 17
      mesonbuild/dependencies.py
  2. 3
      mesonbuild/mesonlib.py

@ -25,6 +25,7 @@ import sysconfig
from . mesonlib import MesonException from . mesonlib import MesonException
from . import mlog from . import mlog
from . import mesonlib from . import mesonlib
from .environment import detect_cpu_family
class DependencyException(MesonException): class DependencyException(MesonException):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@ -582,11 +583,21 @@ class BoostDependency(Dependency):
return self.detect_lib_modules_nix() return self.detect_lib_modules_nix()
def detect_lib_modules_win(self): 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*' gl = 'lib32*'
else: elif arch == 'x86_64':
gl = 'lib64*' 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: if len(libdir) == 0:
return return
libdir = libdir[0] libdir = libdir[0]

@ -91,9 +91,6 @@ def is_windows():
platname = platform.system().lower() platname = platform.system().lower()
return platname == 'windows' or 'mingw' in platname return platname == 'windows' or 'mingw' in platname
def is_32bit():
return not(sys.maxsize > 2**32)
def is_debianlike(): def is_debianlike():
return os.path.isfile('/etc/debian_version') return os.path.isfile('/etc/debian_version')

Loading…
Cancel
Save