aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-10-04 00:07:44 -0400
committerXavier Claessens <xclaesse@gmail.com>2020-09-13 13:54:47 -0400
commit9d338200dacdf24c50259c309380200f8a53d5b5 (patch)
tree8e268a9357119265f11b30791f56e8e09fec393e /mesonbuild/dependencies/base.py
parent19696c3dcdb379f4c5b88457f43242f2d33427a0 (diff)
downloadmeson-9d338200dacdf24c50259c309380200f8a53d5b5.zip
meson-9d338200dacdf24c50259c309380200f8a53d5b5.tar.gz
meson-9d338200dacdf24c50259c309380200f8a53d5b5.tar.bz2
external-project: New module to build configure/make projects
This adds an experimental meson module to build projects with other build systems. Closes: #4316
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r--mesonbuild/dependencies/base.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 69b81d5..8d2f759 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -642,28 +642,35 @@ class PkgConfigDependency(ExternalDependency):
mlog.debug("Called `{}` -> {}\n{}".format(call, rc, out))
return rc, out, err
- def _call_pkgbin(self, args, env=None):
- # Always copy the environment since we're going to modify it
- # with pkg-config variables
- if env is None:
- env = os.environ.copy()
- else:
- env = env.copy()
-
- extra_paths = self.env.coredata.builtins_per_machine[self.for_machine]['pkg_config_path'].value
- sysroot = self.env.properties[self.for_machine].get_sys_root()
+ @staticmethod
+ def setup_env(env, environment, for_machine, extra_path=None):
+ extra_paths = environment.coredata.builtins_per_machine[for_machine]['pkg_config_path'].value
+ if extra_path:
+ extra_paths.append(extra_path)
+ sysroot = environment.properties[for_machine].get_sys_root()
if sysroot:
env['PKG_CONFIG_SYSROOT_DIR'] = sysroot
new_pkg_config_path = ':'.join([p for p in extra_paths])
mlog.debug('PKG_CONFIG_PATH: ' + new_pkg_config_path)
env['PKG_CONFIG_PATH'] = new_pkg_config_path
- pkg_config_libdir_prop = self.env.properties[self.for_machine].get_pkg_config_libdir()
+ pkg_config_libdir_prop = environment.properties[for_machine].get_pkg_config_libdir()
if pkg_config_libdir_prop:
new_pkg_config_libdir = ':'.join([p for p in pkg_config_libdir_prop])
env['PKG_CONFIG_LIBDIR'] = new_pkg_config_libdir
mlog.debug('PKG_CONFIG_LIBDIR: ' + new_pkg_config_libdir)
+
+ def _call_pkgbin(self, args, env=None):
+ # Always copy the environment since we're going to modify it
+ # with pkg-config variables
+ if env is None:
+ env = os.environ.copy()
+ else:
+ env = env.copy()
+
+ PkgConfigDependency.setup_env(env, self.env, self.for_machine)
+
fenv = frozenset(env.items())
targs = tuple(args)
cache = PkgConfigDependency.pkgbin_cache