Commit 2b827c9c authored by Gert Wollny's avatar Gert Wollny Committed by Gert Wollny

meson-options: Make it possible to call this script from anywhere

Resolve the directory where meson_options.txt is located. This is
helpful for running the script in out-of-tree builds.

v2: Use __file__ (Dylan) and simplify path evaluation
Signed-off-by: Gert Wollny's avatarGert Wollny <gert.wollny@collabora.com>
parent b15e6b8b
Pipeline #68341 passed with stages
in 16 minutes and 47 seconds
#!/usr/bin/env python3
from os import get_terminal_size
from os.path import dirname, join
from textwrap import wrap
from mesonbuild import coredata
from mesonbuild import optinterpreter
......@@ -21,7 +22,8 @@ def describe_option(option_name: str, option_default_value: str,
print('---')
oi = optinterpreter.OptionInterpreter('')
oi.process('meson_options.txt')
option_file = join(dirname(__file__), '..', 'meson_options.txt')
oi.process(option_file)
for (name, value) in oi.options.items():
if isinstance(value, coredata.UserStringOption):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment