mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
common.get_meson(): use MESONINTROSPECT if present
If meson has set this, it takes priority over whatever we may find in PATH.
This commit is contained in:
parent
c6c09b7317
commit
d106c2f8df
1 changed files with 16 additions and 0 deletions
16
common.py
16
common.py
|
@ -2,6 +2,7 @@ import argparse
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import shlex
|
||||
|
||||
|
||||
ROOTDIR = os.path.abspath(os.path.dirname(__file__))
|
||||
|
@ -58,6 +59,21 @@ def get_meson():
|
|||
if os.path.exists(meson):
|
||||
return meson
|
||||
|
||||
mesonintrospect = os.environ.get('MESONINTROSPECT', '')
|
||||
for comp in shlex.split (mesonintrospect):
|
||||
# mesonintrospect might look like "/usr/bin/python /somewhere/meson introspect",
|
||||
# let's not get tricked
|
||||
if 'python' in os.path.basename (comp):
|
||||
continue
|
||||
if os.path.exists (comp):
|
||||
mesondir = os.path.dirname(comp)
|
||||
if mesonintrospect.endswith('.py'):
|
||||
meson = os.path.join(mesondir, 'meson.py')
|
||||
else:
|
||||
meson = os.path.join(mesondir, 'meson')
|
||||
if os.path.exists (meson):
|
||||
return meson
|
||||
|
||||
meson = accept_command(["meson.py", "meson"])
|
||||
|
||||
return meson
|
||||
|
|
Loading…
Reference in a new issue