Merge pull request #1518 from centricular/mesonintrospect-evar
Export MESONINTROSPECT to postconf/install/run_command scriptspull/1568/head
commit
761b28371a
9 changed files with 79 additions and 30 deletions
@ -0,0 +1,20 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import os |
||||
import sys |
||||
|
||||
do_print = False |
||||
|
||||
if len(sys.argv) > 1: |
||||
do_print = bool(sys.argv[1]) |
||||
|
||||
if 'MESONINTROSPECT' not in os.environ: |
||||
raise RuntimeError('MESONINTROSPECT not found') |
||||
|
||||
mesonintrospect = os.environ['MESONINTROSPECT'] |
||||
|
||||
if not os.path.isfile(mesonintrospect): |
||||
raise RuntimeError('{!r} does not exist'.format(mesonintrospect)) |
||||
|
||||
if do_print: |
||||
print(mesonintrospect, end='') |
@ -0,0 +1,14 @@ |
||||
project('mesonintrospect from scripts', 'c') |
||||
|
||||
python = import('python3').find_python() |
||||
|
||||
ret = run_command(python, ['check_env.py', '1']) |
||||
if ret.returncode() == 0 |
||||
find_program(ret.stdout()) |
||||
else |
||||
message(ret.stdout()) |
||||
message(ret.stderr()) |
||||
endif |
||||
|
||||
meson.add_postconf_script('check_env.py') |
||||
meson.add_install_script('check_env.py') |
Loading…
Reference in new issue