aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-02-14 20:13:17 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-02-14 20:13:17 +0200
commit25793975d7b01737612fa42381d26e7af1d1310d (patch)
treeb1944f9de2417539f6626d5001efe0403ebf72d7
parentbbe4656c51012bd13da44c00ec6c5af6caa93351 (diff)
downloadmeson-25793975d7b01737612fa42381d26e7af1d1310d.zip
meson-25793975d7b01737612fa42381d26e7af1d1310d.tar.gz
meson-25793975d7b01737612fa42381d26e7af1d1310d.tar.bz2
Can ask pkg-config to provide static libraries. Closes #380.
-rw-r--r--mesonbuild/dependencies.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py
index 974559f..b89bc11 100644
--- a/mesonbuild/dependencies.py
+++ b/mesonbuild/dependencies.py
@@ -72,6 +72,9 @@ class PkgConfigDependency(Dependency):
Dependency.__init__(self)
self.is_libtool = False
self.required = kwargs.get('required', True)
+ self.static = kwargs.get('static', False)
+ if not isinstance(self.static, bool):
+ raise DependencyException('Static keyword must be boolean')
if 'native' in kwargs and environment.is_cross_build():
want_cross = not kwargs['native']
else:
@@ -133,7 +136,10 @@ class PkgConfigDependency(Dependency):
(name, out.decode(errors='ignore')))
self.cargs = out.decode().split()
- p = subprocess.Popen([pkgbin, '--libs', name], stdout=subprocess.PIPE,
+ libcmd = [pkgbin, '--libs']
+ if self.static:
+ libcmd.append('--static')
+ p = subprocess.Popen(libcmd + [name], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode != 0:
@@ -1074,7 +1080,7 @@ def get_dep_identifier(name, kwargs):
modlist = [modlist]
for module in modlist:
elements.append(module)
- return '/'.join(elements) + '/main' + str(kwargs.get('main', False))
+ return '/'.join(elements) + '/main' + str(kwargs.get('main', False)) + '/static' + str(kwargs.get('static', False))
def find_external_dependency(name, environment, kwargs):
required = kwargs.get('required', True)