Commit 9fc990e8 authored by Inigo Martínez's avatar Inigo Martínez Committed by Thomas Haller

build: library paths as parameters for generate-settings-docs.py

generate-settings-docs.py script uses the `LD_LIBRARY_PATH` to
prepend directories to the library search path, which is useful to
load a just built libnm shared library, when generating the
`nm-settings-docs.xml` and `nm-property-docs.xml` files.

However, this is a problem for meson, which is not able to set
environment variables when executing the script.

This patch adds a new optional parameter, `-l` or `--lib-path` that
can be used to pass different paths to be prepended without using
the `LD_LIBRARY_PATH` environment, which can still be used.

[thaller@redhat.com: fix script to handle None lib_path argument]

https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00044.html
parent 7d074fa6
......@@ -183,6 +183,7 @@ def usage():
exit()
parser = argparse.ArgumentParser()
parser.add_argument('-l', '--lib-path', metavar='PATH', action='append', help='path to scan for shared libraries')
parser.add_argument('-g', '--gir', metavar='FILE', help='NM-1.0.gir file')
parser.add_argument('-x', '--overrides', metavar='FILE', help='documentation overrides file')
parser.add_argument('-o', '--output', metavar='FILE', help='output file')
......@@ -191,6 +192,10 @@ args = parser.parse_args()
if args.gir is None or args.output is None:
usage()
if args.lib_path:
for lib in args.lib_path:
GIRepository.Repository.prepend_library_path(lib)
girxml = ET.parse(args.gir).getroot()
outfile = open(args.output, mode='w')
......
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