diff options
author | Nicolas Schneider <nioncode+git@gmail.com> | 2016-03-03 22:28:56 +0100 |
---|---|---|
committer | Nicolas Schneider <nioncode+git@gmail.com> | 2016-03-03 22:28:56 +0100 |
commit | 749aeefe0cb4a7452d95249c9dac4c87e1e414b0 (patch) | |
tree | e0b81e08fdfd2c89def13335af39b63161d6a3b1 /mesonbuild/backend/backends.py | |
parent | 5498f16fb35717a3175e61bf65666c43089efc30 (diff) | |
download | meson-749aeefe0cb4a7452d95249c9dac4c87e1e414b0.zip meson-749aeefe0cb4a7452d95249c9dac4c87e1e414b0.tar.gz meson-749aeefe0cb4a7452d95249c9dac4c87e1e414b0.tar.bz2 |
pass meson source and build dirs as env variables for postconf scripts
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 311e16c..286afa9 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -438,6 +438,12 @@ class Backend(): return (srcs, ofilenames, cmd) def run_postconf_scripts(self): + env = {'MESON_SOURCE_ROOT' : self.environment.get_source_dir(), + 'MESON_BUILD_ROOT' : self.environment.get_build_dir() + } + child_env = os.environ.copy() + child_env.update(env) + for s in self.build.postconf_scripts: - cmd = s['exe'].get_command() + [self.environment.get_source_dir(), self.environment.get_build_dir()] + s['args'] - subprocess.check_call(cmd) + cmd = s['exe'].get_command() + s['args'] + subprocess.check_call(cmd, env=child_env) |