aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-04-08 21:25:25 +0300
committerGitHub <noreply@github.com>2017-04-08 21:25:25 +0300
commit761b28371a52ddb34457e15a801fd26b68e30381 (patch)
tree3ac51b036bdb953e39acb19a2f8e4371e3074ad6 /mesonbuild/mesonlib.py
parent664c2c909b35e8c37becf7bdfc948bf365a38e80 (diff)
parent27f5f0a9633b310f537f09ba0fdd79d86fcb962a (diff)
downloadmeson-761b28371a52ddb34457e15a801fd26b68e30381.zip
meson-761b28371a52ddb34457e15a801fd26b68e30381.tar.gz
meson-761b28371a52ddb34457e15a801fd26b68e30381.tar.bz2
Merge pull request #1518 from centricular/mesonintrospect-evar
Export MESONINTROSPECT to postconf/install/run_command scripts
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r--mesonbuild/mesonlib.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 291eb68..a2ab484 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -175,6 +175,15 @@ class File:
def relative_name(self):
return os.path.join(self.subdir, self.fname)
+def get_meson_script(env, script):
+ '''
+ Given the path of `meson.py`/`meson`, get the path of a meson script such
+ as `mesonintrospect` or `mesontest`.
+ '''
+ meson_py = env.get_build_command()
+ (base, ext) = os.path.splitext(meson_py)
+ return os.path.join(os.path.dirname(base), script + ext)
+
def get_compiler_for_source(compilers, src):
for comp in compilers:
if comp.can_compile(src):