diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-09-30 15:30:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-30 15:30:57 -0400 |
commit | 295b67df518805a1120671e3b248ff0672a89b93 (patch) | |
tree | d0b3a80cb6af908c77e4fadf685046a0313efb51 /mesonbuild/dependencies.py | |
parent | 338dbc964cf2927d476d1fb89a5751e8cfce39bd (diff) | |
parent | 89753ecc27c9857be2554b1af7fe1f5162b8e761 (diff) | |
download | meson-295b67df518805a1120671e3b248ff0672a89b93.zip meson-295b67df518805a1120671e3b248ff0672a89b93.tar.gz meson-295b67df518805a1120671e3b248ff0672a89b93.tar.bz2 |
Merge pull request #814 from centricular/heavy-cleanup-compilers-buildtargets
Heavy cleanup in compilers and BuildTarget
Diffstat (limited to 'mesonbuild/dependencies.py')
-rw-r--r-- | mesonbuild/dependencies.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py index 106273c..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): @@ -474,7 +475,12 @@ class BoostDependency(Dependency): def __init__(self, environment, kwargs): Dependency.__init__(self) self.name = 'boost' + self.environment = environment self.libdir = '' + if 'native' in kwargs and environment.is_cross_build(): + want_cross = not kwargs['native'] + else: + want_cross = environment.is_cross_build() try: self.boost_root = os.environ['BOOST_ROOT'] if not os.path.isabs(self.boost_root): @@ -482,6 +488,8 @@ class BoostDependency(Dependency): except KeyError: self.boost_root = None if self.boost_root is None: + if want_cross: + raise DependencyException('BOOST_ROOT is needed while cross-compiling') if mesonlib.is_windows(): self.boost_root = self.detect_win_root() self.incdir = self.boost_root @@ -575,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] |