diff options
author | Wade Berrier <wberrier@gmail.com> | 2017-04-05 08:03:46 -0600 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-04-09 01:31:35 +0300 |
commit | b89af8b6dd0efc97867be96e91630d8a1c4d3316 (patch) | |
tree | 2b70192baa3a1ada7266f68d2b8e0f55cf8e7e97 /mesonbuild/dependencies.py | |
parent | 79208fd9c4e6c865f4ef12ce992d5e3d8c7f4ad4 (diff) | |
download | meson-b89af8b6dd0efc97867be96e91630d8a1c4d3316.zip meson-b89af8b6dd0efc97867be96e91630d8a1c4d3316.tar.gz meson-b89af8b6dd0efc97867be96e91630d8a1c4d3316.tar.bz2 |
Add support for BOOST_INCLUDEDIR and BOOST_LIBRARYDIR
In case they are not decendants of BOOST_ROOT...
(Idea copied from CMake FindBoost)
Fix for #1562
authors.txt: add myself as requested
Diffstat (limited to 'mesonbuild/dependencies.py')
-rw-r--r-- | mesonbuild/dependencies.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py index 7f22ae6..2b110bb 100644 --- a/mesonbuild/dependencies.py +++ b/mesonbuild/dependencies.py @@ -598,12 +598,18 @@ class BoostDependency(Dependency): self.boost_root = None if self.boost_root is None: if self.want_cross: - raise DependencyException('BOOST_ROOT is needed while cross-compiling') + if 'BOOST_INCLUDEDIR' in os.environ: + self.incdir = os.environ['BOOST_INCLUDEDIR'] + else: + raise DependencyException('BOOST_ROOT or BOOST_INCLUDEDIR is needed while cross-compiling') if mesonlib.is_windows(): self.boost_root = self.detect_win_root() self.incdir = self.boost_root else: - self.incdir = '/usr/include' + if 'BOOST_INCLUDEDIR' in os.environ: + self.incdir = os.environ['BOOST_INCLUDEDIR'] + else: + self.incdir = '/usr/include' else: self.incdir = os.path.join(self.boost_root, 'include') self.boost_inc_subdir = os.path.join(self.incdir, 'boost') @@ -727,7 +733,9 @@ class BoostDependency(Dependency): libsuffix = 'so' globber = 'libboost_*.{}'.format(libsuffix) - if self.boost_root is None: + if 'BOOST_LIBRARYDIR' in os.environ: + libdirs = [os.environ['BOOST_LIBRARYDIR']] + elif self.boost_root is None: libdirs = mesonlib.get_library_dirs() else: libdirs = [os.path.join(self.boost_root, 'lib')] @@ -758,6 +766,8 @@ class BoostDependency(Dependency): args = [] if self.boost_root: args.append('-L' + os.path.join(self.boost_root, 'lib')) + elif 'BOOST_LIBRARYDIR' in os.environ: + args.append('-L' + os.environ['BOOST_LIBRARYDIR']) for module in self.requested_modules: module = BoostDependency.name2lib.get(module, module) libname = 'boost_' + module |