summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2020-04-23 13:51:03 +1000
committerMatthew Waters <matthew@centricular.com>2020-04-23 13:51:03 +1000
commit72d92cc66e4d03791498d34c8d6873e11033ffd1 (patch)
tree5190d0c728d6675ad99443fbea956208c7221f78 /meson.build
parentd255d5b50321af682a73febf0aeacc0b44aa1e19 (diff)
build: also read the subproject list from a generated file
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/60 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/84>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build36
1 files changed, 34 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 865582c..b8e468e 100644
--- a/meson.build
+++ b/meson.build
@@ -12,12 +12,44 @@ else
pathsep = ':'
endif
+python3 = import('python').find_installation()
+
+built_subprojects = get_option('built_subprojects')
+if built_subprojects != ''
+ message('Have subprojects list from options')
+else
+ read_file_contents = '''
+import os
+import sys
+
+assert len(sys.argv) >= 2
+fname = sys.argv[1]
+
+with open(fname, 'r') as f:
+ for l in f:
+ print(l)
+'''
+
+ # gst-build will generate this file for us to consume so that subproject
+ # changes can still work
+ fname = join_paths(meson.build_root(), 'GstDocumentedSubprojects')
+ cmdres = run_command(
+ python3,
+ '-c', read_file_contents,
+ fname,
+ )
+ if cmdres.returncode() == 0
+ built_subprojects = cmdres.stdout().strip()
+ message('Have subprojects from file: @0@'.format(fname))
+ endif
+endif
+
libs = ''
plugins_doc = ''
deps = []
plugins_sitemap = ''
-if get_option('built_subprojects') != ''
- foreach project_name: get_option('built_subprojects').split(',')
+if built_subprojects != ''
+ foreach project_name: built_subprojects.split(',')
sub = subproject(project_name)
if sub.get_variable('build_hotdoc')
message('Building @0@ documentation'.format(project_name))