diff options
author | Niklas Claesson <niklas.claesson@cosylab.com> | 2017-11-30 22:46:45 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-12-03 23:21:33 +0200 |
commit | 98845085359d6e49ece3204f2ed7f82a2582306b (patch) | |
tree | 7b5b722b7111cbc2688878945942cd1e2f27d64e | |
parent | 112e6c1927760d33d9392b0aa3ed26596bbe68f7 (diff) | |
download | meson-98845085359d6e49ece3204f2ed7f82a2582306b.zip meson-98845085359d6e49ece3204f2ed7f82a2582306b.tar.gz meson-98845085359d6e49ece3204f2ed7f82a2582306b.tar.bz2 |
Boost: Pick correct version
If many binary packages are installed, pick the one built with the correct
toolset. Fixes #2532
-rw-r--r-- | mesonbuild/dependencies/misc.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 1d19b04..61dd953 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -237,17 +237,18 @@ class BoostDependency(ExternalDependency): def detect_lib_modules_win(self): arch = detect_cpu_family(self.env.coredata.compilers) - compiler_ts = self.env.detect_cpp_compiler(self.want_cross).get_toolset_version().split('.') + comp_ts_version = self.env.detect_cpp_compiler(self.want_cross).get_toolset_version() + compiler_ts = comp_ts_version.split('.') compiler = 'vc{}{}'.format(compiler_ts[0], compiler_ts[1]) if not self.libdir: - # The libdirs in the distributed binaries + # The libdirs in the distributed binaries (from sf) if arch == 'x86': - gl = 'lib32*' + lib_sf = 'lib32-msvc-{}'.format(comp_ts_version) elif arch == 'x86_64': - gl = 'lib64*' + lib_sf = 'lib64-msvc-{}'.format(comp_ts_version) else: # Does anyone do Boost cross-compiling to other archs on Windows? - gl = None + lib_sf = None if self.boost_root: roots = [self.boost_root] else: @@ -258,11 +259,10 @@ class BoostDependency(ExternalDependency): if os.path.isdir(libdir): self.libdir = libdir break - if gl: - tmp = glob.glob(os.path.join(root, gl)) - if len(tmp) > 0: - # FIXME: Should pick the correct version - self.libdir = tmp[0] + if lib_sf: + full_path = os.path.join(root, lib_sf) + if os.path.isdir(full_path): + self.libdir = full_path break if not self.libdir: |