From 71d24094cd1fb03a2acfc96bb5094539f185dff5 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Fri, 22 Dec 2017 15:37:11 -0800 Subject: Factor out code to compute modname from basename into a single place. --- mesonbuild/dependencies/misc.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index ea0711f..6f6624a 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -250,6 +250,14 @@ class BoostDependency(ExternalDependency): return self.detect_lib_modules_win() return self.detect_lib_modules_nix() + def modname_from_filename(self, filename): + modname = os.path.basename(filename) + modname = modname.split('.', 1)[0] + modname = modname.split('-', 1)[0] + if modname.startswith('libboost'): + modname = modname[3:] + return modname + def detect_lib_modules_win(self): arch = detect_cpu_family(self.env.coredata.compilers) comp_ts_version = self.env.detect_cpp_compiler(self.want_cross).get_toolset_version() @@ -291,8 +299,7 @@ class BoostDependency(ExternalDependency): libname = libname + '-gd' libname = libname + "-{}.lib".format(self.version.replace('.', '_')) if os.path.isfile(os.path.join(self.libdir, libname)): - modname = libname.split('-', 1)[0][3:] - self.lib_modules[modname] = libname + self.lib_modules[self.modname_from_filename(libname)] = libname else: libname = "lib{}.lib".format(name) if os.path.isfile(os.path.join(self.libdir, libname)): @@ -309,22 +316,13 @@ class BoostDependency(ExternalDependency): globber2 = globber2 + '-{}'.format(self.version.replace('.', '_')) globber2_matches = glob.glob(os.path.join(self.libdir, globber2 + '.lib')) for entry in globber2_matches: - (_, fname) = os.path.split(entry) - modname = fname.split('-', 1) - if len(modname) > 1: - modname = modname[0] - else: - modname = modname.split('.', 1)[0] - if self.static: - modname = modname[3:] - self.lib_modules[modname] = fname + fname = os.path.basename(entry) + self.lib_modules[self.modname_from_filename(fname)] = fname if len(globber2_matches) == 0: for entry in glob.glob(os.path.join(self.libdir, globber1 + '.lib')): - (_, fname) = os.path.split(entry) - modname = fname.split('.', 1)[0] if self.static: - modname = modname[3:] - self.lib_modules[modname] = fname + fname = os.path.basename(entry) + self.lib_modules[self.modname_from_filename(fname)] = fname def detect_lib_modules_nix(self): if self.static: @@ -347,19 +345,21 @@ class BoostDependency(ExternalDependency): if os.path.isfile(os.path.join(libdir, libname)): self.lib_modules[name] = libname for entry in glob.glob(os.path.join(libdir, globber)): - lib = os.path.basename(entry) - name = lib.split('.')[0][3:] # I'm not 100% sure what to do here. Some distros # have modules such as thread only as -mt versions. # On debian all packages are built threading=multi # but not suffixed with -mt. # FIXME: implement detect_lib_modules_{debian, redhat, ...} + # FIXME: this wouldn't work with -mt-gd either. -BDR if self.is_multithreading and mesonlib.is_debianlike(): - self.lib_modules[name] = lib + pass elif self.is_multithreading and entry.endswith('-mt.{}'.format(libsuffix)): - self.lib_modules[name] = lib + pass elif not entry.endswith('-mt.{}'.format(libsuffix)): - self.lib_modules[name] = lib + pass + else: + continue + self.lib_modules[self.modname_from_filename(entry)] = os.path.basename(entry) def get_win_link_args(self): args = [] -- cgit v1.1 From 4c7802b107d8fc09dda2e7846d8a6f653f1b11fb Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Mon, 25 Dec 2017 21:30:16 -0800 Subject: Link against the library files that we found during module detection. --- mesonbuild/dependencies/misc.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 6f6624a..99c82e8 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -359,7 +359,9 @@ class BoostDependency(ExternalDependency): pass else: continue - self.lib_modules[self.modname_from_filename(entry)] = os.path.basename(entry) + modname = self.modname_from_filename(entry) + if modname not in self.lib_modules: + self.lib_modules[modname] = entry def get_win_link_args(self): args = [] @@ -379,14 +381,7 @@ class BoostDependency(ExternalDependency): elif self.libdir: args.append('-L' + self.libdir) for lib in self.requested_modules: - # The compiler's library detector is the most reliable so use that first. - boost_lib = 'boost_' + lib - default_detect = self.compiler.find_library(boost_lib, self.env, []) - if default_detect is not None: - args += default_detect - elif boost_lib in self.lib_modules: - linkcmd = '-l' + boost_lib - args.append(linkcmd) + args += [self.lib_modules['boost_' + lib]] return args def get_sources(self): -- cgit v1.1 From 074bd544c7d2b12d00a4140fa8f12dde60b364c8 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 10:04:56 -0800 Subject: Fix typo. --- mesonbuild/dependencies/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 99c82e8..19fdc19 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -52,7 +52,7 @@ from .base import ( # - boost_.lib|.dll (shared) # where compiler is vc141 for example. # -# NOTE: -gb means runtime and build time debugging is on +# NOTE: -gd means runtime and build time debugging is on # -mt means threading=multi # # The `modules` argument accept library names. This is because every module that -- cgit v1.1 From 1af17075abb8d64a0322bb7b182515036b933569 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 10:09:59 -0800 Subject: Add information about Linux and Mac. --- mesonbuild/dependencies/misc.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 19fdc19..c21b4f1 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -62,6 +62,24 @@ from .base import ( # * http://www.boost.org/doc/libs/1_65_1/doc/html/stacktrace/configuration_and_build.html # * http://www.boost.org/doc/libs/1_65_1/libs/math/doc/html/math_toolkit/main_tr1.html +# **On Unix**, official packaged versions of boost libraries follow the following schemes: +# +# Linux / Debian: libboost_.so.1.66.0 -> libboost_.so +# Linux / Red Hat: libboost_.so.1.66.0 -> libboost_.so +# Linux / OpenSuse: libboost_.so.1.66.0 -> libboost_.so +# Mac / homebrew: libboost_.dylib + libboost_-mt.dylib (location = /usr/local/lib) +# Mac / macports: libboost_.dylib + libboost_-mt.dylib (location = /opt/local/lib) +# +# Its not clear that any other abi tags (e.g. -gd) are used in official packages. +# +# On Linux systems, boost libs have multithreading support enabled, but without the -mt tag. +# +# Boost documentation recommends using complex abi tags like "-lboost_regex-gcc34-mt-d-1_36". +# (See http://www.boost.org/doc/libs/1_66_0/more/getting_started/unix-variants.html#library-naming) +# However, its not clear that any Unix distribution follows this scheme. +# Furthermore, the boost documentation for unix above uses examples from windows like +# "libboost_regex-vc71-mt-d-x86-1_34.lib", so apparently the abi tags may be more aimed at windows. +# class BoostDependency(ExternalDependency): def __init__(self, environment, kwargs): super().__init__('boost', environment, 'cpp', kwargs) -- cgit v1.1 From d55f330df0236079c4d425ea52e0160b59c6e90c Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 10:11:53 -0800 Subject: Change values in lib_modules dict to lists (of linker args). --- mesonbuild/dependencies/misc.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index c21b4f1..38f7a82 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -317,11 +317,11 @@ class BoostDependency(ExternalDependency): libname = libname + '-gd' libname = libname + "-{}.lib".format(self.version.replace('.', '_')) if os.path.isfile(os.path.join(self.libdir, libname)): - self.lib_modules[self.modname_from_filename(libname)] = libname + self.lib_modules[self.modname_from_filename(libname)] = [libname] else: libname = "lib{}.lib".format(name) if os.path.isfile(os.path.join(self.libdir, libname)): - self.lib_modules[name[3:]] = libname + self.lib_modules[name[3:]] = [libname] # globber1 applies to a layout=system installation # globber2 applies to a layout=versioned installation @@ -335,12 +335,12 @@ class BoostDependency(ExternalDependency): globber2_matches = glob.glob(os.path.join(self.libdir, globber2 + '.lib')) for entry in globber2_matches: fname = os.path.basename(entry) - self.lib_modules[self.modname_from_filename(fname)] = fname + self.lib_modules[self.modname_from_filename(fname)] = [fname] if len(globber2_matches) == 0: for entry in glob.glob(os.path.join(self.libdir, globber1 + '.lib')): if self.static: fname = os.path.basename(entry) - self.lib_modules[self.modname_from_filename(fname)] = fname + self.lib_modules[self.modname_from_filename(fname)] = [fname] def detect_lib_modules_nix(self): if self.static: @@ -361,7 +361,7 @@ class BoostDependency(ExternalDependency): for name in self.need_static_link: libname = 'lib{}.a'.format(name) if os.path.isfile(os.path.join(libdir, libname)): - self.lib_modules[name] = libname + self.lib_modules[name] = [libname] for entry in glob.glob(os.path.join(libdir, globber)): # I'm not 100% sure what to do here. Some distros # have modules such as thread only as -mt versions. @@ -379,7 +379,7 @@ class BoostDependency(ExternalDependency): continue modname = self.modname_from_filename(entry) if modname not in self.lib_modules: - self.lib_modules[modname] = entry + self.lib_modules[modname] = [entry] def get_win_link_args(self): args = [] @@ -387,7 +387,7 @@ class BoostDependency(ExternalDependency): if self.libdir: args.append('-L' + self.libdir) for lib in self.requested_modules: - args.append(self.lib_modules['boost_' + lib]) + args += self.lib_modules['boost_' + lib] return args def get_link_args(self): @@ -399,7 +399,7 @@ class BoostDependency(ExternalDependency): elif self.libdir: args.append('-L' + self.libdir) for lib in self.requested_modules: - args += [self.lib_modules['boost_' + lib]] + args += self.lib_modules['boost_' + lib] return args def get_sources(self): -- cgit v1.1 From c62078dae5c2dbecabdd99b905cdf561b5cc22e9 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 10:35:33 -0800 Subject: Add missing for_linux( ) function. --- mesonbuild/mesonlib.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mesonbuild') diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 6bf31db..66bf98e 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -309,6 +309,18 @@ def for_cygwin(is_cross, env): return env.cross_info.config['host_machine']['system'] == 'cygwin' return False +def for_linux(is_cross, env): + """ + Host machine is linux? + + Note: 'host' is the machine on which compiled binaries will run + """ + if not is_cross: + return is_linux() + elif env.cross_info.has_host(): + return env.cross_info.config['host_machine']['system'] == 'linux' + return False + def for_darwin(is_cross, env): """ Host machine is Darwin (iOS/OS X)? -- cgit v1.1 From 1043b0b4a2f63ec0f8dded73afbcdfeb26143909 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 10:51:50 -0800 Subject: Factor out extra linker search dirs into new function. --- mesonbuild/dependencies/misc.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 38f7a82..08afcd6 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -390,14 +390,20 @@ class BoostDependency(ExternalDependency): args += self.lib_modules['boost_' + lib] return args + def extra_lib_dirs(self): + dirs = [] + if self.boost_root: + dirs= [ os.path.join(self.boost_root, 'lib')] + elif self.libdir: + dirs = [ self.libdir ] + return dirs + def get_link_args(self): if mesonlib.is_windows(): return self.get_win_link_args() args = [] - if self.boost_root: - args.append('-L' + os.path.join(self.boost_root, 'lib')) - elif self.libdir: - args.append('-L' + self.libdir) + for dir in self.extra_lib_dirs(): + args += ['-L' + dir] for lib in self.requested_modules: args += self.lib_modules['boost_' + lib] return args -- cgit v1.1 From a82abfcb4ac3e1ed2fbec82a248fb012e3c85210 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 10:52:50 -0800 Subject: Use new strategy for finding libraries on Linux & Mac. --- mesonbuild/dependencies/misc.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 08afcd6..cc2b2b7 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -80,6 +80,21 @@ from .base import ( # Furthermore, the boost documentation for unix above uses examples from windows like # "libboost_regex-vc71-mt-d-x86-1_34.lib", so apparently the abi tags may be more aimed at windows. # +# Probably we should use the linker search path to decide which libraries to use. This will +# make it possible to find the macports boost libraries without setting BOOST_ROOT, and will +# also mean that it would be possible to use user-installed boost libraries when official +# packages are installed. +# +# We thus follow the following strategy: +# 1. Look for libraries using compiler.find_library( ) +# 1.1 On Linux, just look for boost_ +# 1.2 On other systems (e.g. Mac) look for boost_-mt if multithreading. +# 1.3 Otherwise look for boost_ +# 2. Fall back to previous approach +# 2.1. Search particular directories. +# 2.2. Find boost libraries with unknown suffixes using file-name globbing. + + class BoostDependency(ExternalDependency): def __init__(self, environment, kwargs): super().__init__('boost', environment, 'cpp', kwargs) @@ -343,6 +358,24 @@ class BoostDependency(ExternalDependency): self.lib_modules[self.modname_from_filename(fname)] = [fname] def detect_lib_modules_nix(self): + all_found = True + for module in self.requested_modules: + args = None + libname = 'boost_'+module + if self.is_multithreading and not mesonlib.for_linux(self.want_cross, self.env): + # - Linux leaves off -mt but libraries are multithreading-aware. + # - Mac requires -mt for multithreading, so should not fall back to non-mt libraries. + libname = libname + '-mt' + args = self.compiler.find_library(libname, self.env, self.extra_lib_dirs()) + if args is None: + mlog.debug('Couldn\'t find library "{}" for boost module "{}"'.format(module, libname)) + all_found = False + else: + mlog.debug('Link args for boost module "{}" are {}'.format(module, args)) + self.lib_modules['boost_' + module] = args + if all_found: + return + if self.static: libsuffix = 'a' elif mesonlib.is_osx() and not self.want_cross: -- cgit v1.1 From ea4d5697a8f874df197e33a4cbf17aa259ebf9e6 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 11:27:46 -0800 Subject: Fix style issues. --- mesonbuild/dependencies/misc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index cc2b2b7..12575d5 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -361,7 +361,7 @@ class BoostDependency(ExternalDependency): all_found = True for module in self.requested_modules: args = None - libname = 'boost_'+module + libname = 'boost_' + module if self.is_multithreading and not mesonlib.for_linux(self.want_cross, self.env): # - Linux leaves off -mt but libraries are multithreading-aware. # - Mac requires -mt for multithreading, so should not fall back to non-mt libraries. @@ -426,9 +426,9 @@ class BoostDependency(ExternalDependency): def extra_lib_dirs(self): dirs = [] if self.boost_root: - dirs= [ os.path.join(self.boost_root, 'lib')] + dirs = [os.path.join(self.boost_root, 'lib')] elif self.libdir: - dirs = [ self.libdir ] + dirs = [self.libdir] return dirs def get_link_args(self): -- cgit v1.1 From 57265e2486fb677353d0e6cf666785a26a576607 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 13:41:57 -0800 Subject: Use include path to find and version number. --- mesonbuild/dependencies/misc.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 12575d5..365f489 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -25,7 +25,7 @@ from pathlib import Path from .. import mlog from .. import mesonlib -from ..mesonlib import Popen_safe, extract_as_list +from ..mesonlib import Popen_safe, extract_as_list, EnvironmentException from ..environment import detect_cpu_family from .base import ( @@ -264,19 +264,16 @@ class BoostDependency(ExternalDependency): def detect_version(self): try: - ifile = open(os.path.join(self.incdir, 'boost', 'version.hpp')) - except FileNotFoundError: + version = self.compiler.get_define('BOOST_LIB_VERSION', '#include ', self.env, self.get_compile_args(), []) + except EnvironmentException: return except TypeError: return - with ifile: - for line in ifile: - if line.startswith("#define") and 'BOOST_LIB_VERSION' in line: - ver = line.split()[-1] - ver = ver[1:-1] - self.version = ver.replace('_', '.') - self.is_found = True - return + # Remove quotes + version = version[1:-1] + # Fix version string + self.version = version.replace('_', '.') + self.is_found = True def detect_lib_modules(self): if mesonlib.is_windows(): -- cgit v1.1 From a12d47984ed02e0b10901a0d56f4844e61e06c7e Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sat, 30 Dec 2017 16:06:17 -0800 Subject: Remove unqualified import and add mesonlib. in from of symbols. --- mesonbuild/dependencies/misc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 365f489..f8be85e 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -25,7 +25,6 @@ from pathlib import Path from .. import mlog from .. import mesonlib -from ..mesonlib import Popen_safe, extract_as_list, EnvironmentException from ..environment import detect_cpu_family from .base import ( @@ -250,7 +249,7 @@ class BoostDependency(ExternalDependency): return args def get_requested(self, kwargs): - candidates = extract_as_list(kwargs, 'modules') + candidates = mesonlib.extract_as_list(kwargs, 'modules') for c in candidates: if not isinstance(c, str): raise DependencyException('Boost module argument is not a string.') @@ -265,7 +264,7 @@ class BoostDependency(ExternalDependency): def detect_version(self): try: version = self.compiler.get_define('BOOST_LIB_VERSION', '#include ', self.env, self.get_compile_args(), []) - except EnvironmentException: + except mesonlib.EnvironmentException: return except TypeError: return -- cgit v1.1 From 075e2d4154ffa2e416a84f68073e5e2da7784d7f Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sun, 31 Dec 2017 08:15:40 -0800 Subject: Add todo comments. --- mesonbuild/dependencies/misc.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index f8be85e..43412dd 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -93,6 +93,14 @@ from .base import ( # 2.1. Search particular directories. # 2.2. Find boost libraries with unknown suffixes using file-name globbing. +# TODO: Unix: Don't assume we know where the boost dir is, rely on -Idir and -Ldir being set. +# TODO: Determine a suffix (e.g. "-mt" or "") and use it. +# TODO: Get_win_link_args( ) and get_link_args( ) +# TODO: Genericize: 'args += ['-L' + dir] => args += self.compiler.get_linker_search_args(dir) +# TODO: Allow user to specify suffix in BOOST_SUFFIX, or add specific options like BOOST_DEBUG for 'd' for debug. +# TODO: fix cross: +# is_windows() -> for_windows(self.want_cross, self.env) +# is_osx() and self.want_cross -> for_darwin(self.want_cross, self.env) class BoostDependency(ExternalDependency): def __init__(self, environment, kwargs): -- cgit v1.1 From ce0b0d463f2870aa5372cb51b7b898cbc649fc4f Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sun, 31 Dec 2017 08:18:55 -0800 Subject: Fix macports builds: don't override include paths unless BOOST_ROOT. We don't want to add /usr/local to the include path, because that will pick up homebrew headers. --- mesonbuild/dependencies/misc.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 43412dd..3e2f780 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -143,7 +143,7 @@ class BoostDependency(ExternalDependency): else: self.incdir = self.detect_nix_incdir() - if self.incdir is None: + if self.incdir is None and mesonlib.is_windows(): self.log_fail() return @@ -152,7 +152,7 @@ class BoostDependency(ExternalDependency): # previous versions of meson allowed include dirs as modules remove = [] for m in invalid_modules: - if m in os.listdir(os.path.join(self.incdir, 'boost')): + if self.incdir and m in os.listdir(os.path.join(self.incdir, 'boost')): mlog.warning('Requested boost library', mlog.bold(m), 'that doesn\'t exist. ' 'This will be an error in the future') remove.append(m) @@ -178,6 +178,7 @@ class BoostDependency(ExternalDependency): else: self.log_fail() + def log_fail(self): module_str = ', '.join(self.requested_modules) mlog.log("Dependency Boost (%s) found:" % module_str, mlog.red('NO')) @@ -212,10 +213,8 @@ class BoostDependency(ExternalDependency): return res def detect_nix_incdir(self): - for root in self.boost_roots: - incdir = os.path.join(root, 'include', 'boost') - if os.path.isdir(incdir): - return os.path.join(root, 'include') + if self.boost_root: + return os.path.join(self.boost_root, 'include') return None # FIXME: Should pick a version that matches the requested version -- cgit v1.1 From 62bec86aa6a0c8e33ef32e43cee0e61bdd110851 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Sun, 31 Dec 2017 13:24:42 -0800 Subject: Handle header-only boost modules on Unix when BOOST_ROOT is not set. --- mesonbuild/dependencies/misc.py | 117 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 3e2f780..cc0914c 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -152,7 +152,7 @@ class BoostDependency(ExternalDependency): # previous versions of meson allowed include dirs as modules remove = [] for m in invalid_modules: - if self.incdir and m in os.listdir(os.path.join(self.incdir, 'boost')): + if m in BOOST_DIRS: mlog.warning('Requested boost library', mlog.bold(m), 'that doesn\'t exist. ' 'This will be an error in the future') remove.append(m) @@ -161,7 +161,7 @@ class BoostDependency(ExternalDependency): invalid_modules = [x for x in invalid_modules if x not in remove] if invalid_modules: - mlog.warning('Invalid Boost modules: ' + ', '.join(invalid_modules)) + mlog.log(mlog.red('ERROR:'), 'Invalid Boost modules: ' + ', '.join(invalid_modules)) self.log_fail() return @@ -1018,3 +1018,116 @@ BOOST_LIBS = [ 'boost_type_erasure', 'boost_wave' ] + +BOOST_DIRS = [ + 'lambda', + 'optional', + 'convert', + 'system', + 'uuid', + 'archive', + 'align', + 'timer', + 'chrono', + 'gil', + 'logic', + 'signals', + 'predef', + 'tr1', + 'multi_index', + 'property_map', + 'multi_array', + 'context', + 'random', + 'endian', + 'circular_buffer', + 'proto', + 'assign', + 'format', + 'math', + 'phoenix', + 'graph', + 'locale', + 'mpl', + 'pool', + 'unordered', + 'core', + 'exception', + 'ptr_container', + 'flyweight', + 'range', + 'typeof', + 'thread', + 'move', + 'spirit', + 'dll', + 'compute', + 'serialization', + 'ratio', + 'msm', + 'config', + 'metaparse', + 'coroutine2', + 'qvm', + 'program_options', + 'concept', + 'detail', + 'hana', + 'concept_check', + 'compatibility', + 'variant', + 'type_erasure', + 'mpi', + 'test', + 'fusion', + 'log', + 'sort', + 'local_function', + 'units', + 'functional', + 'preprocessor', + 'integer', + 'container', + 'polygon', + 'interprocess', + 'numeric', + 'iterator', + 'wave', + 'lexical_cast', + 'multiprecision', + 'utility', + 'tti', + 'asio', + 'dynamic_bitset', + 'algorithm', + 'xpressive', + 'bimap', + 'signals2', + 'type_traits', + 'regex', + 'statechart', + 'parameter', + 'icl', + 'python', + 'lockfree', + 'intrusive', + 'io', + 'pending', + 'geometry', + 'tuple', + 'iostreams', + 'heap', + 'atomic', + 'filesystem', + 'smart_ptr', + 'function', + 'fiber', + 'type_index', + 'accumulators', + 'function_types', + 'coroutine', + 'vmd', + 'date_time', + 'property_tree', + 'bind' +] -- cgit v1.1