summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Zabaluev <mikhail.zabaluev@gmail.com>2015-10-15 15:41:52 +0300
committerMikhail Zabaluev <mikhail.zabaluev@gmail.com>2015-10-15 22:44:28 +0300
commit0f912a4cc489ff3e6d9ac5c47b46b618fba7400b (patch)
tree66f86596a78a7279f73e3b2451b36f0abb9fca8a
parent74fcf8851fd84613399bbcc53150e2e441e80fb2 (diff)
downloadgobject-introspection-0f912a4cc489ff3e6d9ac5c47b46b618fba7400b.tar.gz
Salvage the build directory parameter of update-glib-annotations.py
It was not possible to use the tool with a custom build directory, even when it was given as the second command line parameter. https://bugzilla.gnome.org/show_bug.cgi?id=756665
-rwxr-xr-xmisc/update-glib-annotations.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/misc/update-glib-annotations.py b/misc/update-glib-annotations.py
index e4dc32c4..e415ad86 100755
--- a/misc/update-glib-annotations.py
+++ b/misc/update-glib-annotations.py
@@ -20,14 +20,6 @@ for k in ['UNINSTALLED_INTROSPECTION_SRCDIR',
os.environ[k] = path
possible_builddirs = ['../_build/', '..', '../../build/']
-builddir = None
-for d in possible_builddirs:
- if os.path.isfile(os.path.join(d, 'g-ir-annotation-tool')):
- builddir = d
- break
-assert builddir is not None
-annotation_tool_base_args = [os.path.join(builddir, 'g-ir-annotation-tool'),
- '--extract']
def directory_includes(dirs, srcdir, builddir):
@@ -55,6 +47,9 @@ def extract_annotations(module, srcdir, builddir, outfile):
if sourcename.endswith('.c'):
sources.append(os.path.join(subdir, sourcename))
+ annotation_tool_base_args = [
+ os.path.join(builddir, 'g-ir-annotation-tool'), '--extract']
+
return subprocess.check_call(annotation_tool_base_args +
module['defines'] +
includes +
@@ -67,7 +62,11 @@ if __name__ == '__main__':
if len(sys.argv) == 3:
builddir = sys.argv[2]
else:
- builddir = srcdir
+ for d in possible_builddirs:
+ if os.path.isfile(os.path.join(d, 'g-ir-annotation-tool')):
+ builddir = d
+ break
+ assert builddir is not None
print("Using source directory: '%s' build directory: '%s'" % (srcdir, builddir))