aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-05-29 19:45:13 +0300
committerGitHub <noreply@github.com>2017-05-29 19:45:13 +0300
commited356496fcea539481ee9dd0708c3105d1b3bfb2 (patch)
tree570e31cfaa1ee20b99e6b233e5dfe3a1578213c5
parent93a1cff174d0a7a564783f200d7360162cb6cbc3 (diff)
parentaff955f99f31cbeacb1885d93b51b296b80de18b (diff)
downloadmeson-ed356496fcea539481ee9dd0708c3105d1b3bfb2.zip
meson-ed356496fcea539481ee9dd0708c3105d1b3bfb2.tar.gz
meson-ed356496fcea539481ee9dd0708c3105d1b3bfb2.tar.bz2
Merge pull request #1854 from acfoltzer/boost-static
Add static flag for Boost dependency
-rw-r--r--mesonbuild/dependencies/misc.py11
-rw-r--r--test cases/frameworks/1 boost/meson.build7
2 files changed, 12 insertions, 6 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index 3e0b558..35e840c 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -1,4 +1,4 @@
-# Copyright 2013-2017 The Meson development team
+# Copyright 2013-2017 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -37,6 +37,7 @@ class BoostDependency(Dependency):
self.name = 'boost'
self.environment = environment
self.libdir = ''
+ self.static = kwargs.get('static', False)
if 'native' in kwargs and environment.is_cross_build():
self.want_cross = not kwargs['native']
else:
@@ -194,7 +195,7 @@ class BoostDependency(Dependency):
return
libdir = libdir[0]
self.libdir = libdir
- globber = 'boost_*-gd-*.lib' # FIXME
+ globber = 'libboost_*-gd-*.lib' if self.static else 'boost_*-gd-*.lib' # FIXME
for entry in glob.glob(os.path.join(libdir, globber)):
(_, fname) = os.path.split(entry)
base = fname.split('_', 1)[1]
@@ -202,7 +203,9 @@ class BoostDependency(Dependency):
self.lib_modules_mt[modname] = fname
def detect_lib_modules_nix(self):
- if mesonlib.is_osx() and not self.want_cross:
+ if self.static:
+ libsuffix = 'a'
+ elif mesonlib.is_osx() and not self.want_cross:
libsuffix = 'dylib'
else:
libsuffix = 'so'
@@ -220,7 +223,7 @@ class BoostDependency(Dependency):
name = lib.split('.')[0].split('_', 1)[-1]
# I'm not 100% sure what to do here. Some distros
# have modules such as thread only as -mt versions.
- if entry.endswith('-mt.so'):
+ if entry.endswith('-mt.{}'.format(libsuffix)):
self.lib_modules_mt[name] = True
else:
self.lib_modules[name] = True
diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build
index 6f9b16f..b7ac36d 100644
--- a/test cases/frameworks/1 boost/meson.build
+++ b/test cases/frameworks/1 boost/meson.build
@@ -7,15 +7,18 @@ project('boosttest', 'cpp',
nolinkdep = dependency('boost', modules: 'utility')
linkdep = dependency('boost', modules : ['thread', 'system'])
+staticdep = dependency('boost', modules : ['thread', 'system'], static : true)
testdep = dependency('boost', modules : 'test')
nomoddep = dependency('boost')
nolinkexe = executable('nolinkedexe', 'nolinkexe.cc', dependencies : nolinkdep)
linkexe = executable('linkedexe', 'linkexe.cc', dependencies : linkdep)
+staticexe = executable('linkedexe', 'linkexe.cc', dependencies : staticdep)
unitexe = executable('utf', 'unit_test.cpp', dependencies: testdep)
nomodexe = executable('nomod', 'nomod.cpp', dependencies : nomoddep)
-test('Boost nolinktext', nolinkexe)
-test('Boost linktext', linkexe)
+test('Boost nolinktest', nolinkexe)
+test('Boost linktest', linkexe)
+test('Boost statictest', staticexe)
test('Boost UTF test', unitexe)
test('Boost nomod', nomodexe)