diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-02-14 20:13:17 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-02-14 20:13:17 +0200 |
commit | 25793975d7b01737612fa42381d26e7af1d1310d (patch) | |
tree | b1944f9de2417539f6626d5001efe0403ebf72d7 | |
parent | bbe4656c51012bd13da44c00ec6c5af6caa93351 (diff) | |
download | meson-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.py | 10 |
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) |