From b9d39e2f7f42e35af6476ba61c1f43ea53c5572a Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 23 Apr 2020 13:48:22 +1000 Subject: [PATCH] build: allow for changing subprojects with docs enabled Fixes: https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/60 Part-of: --- meson.build | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index c408d33e20..4302eef809 100644 --- a/meson.build +++ b/meson.build @@ -153,19 +153,41 @@ if meson.is_cross_build() or build_machine.system() == 'windows' error('Documentation enabled but building the doc while cross building or building on windows is not supported yet.') endif + documented_projects = '' message('Documentation not built as building the documentation while cross building or building on windows is not supported yet.') else hotdoc_p = find_program('hotdoc', required : get_option('doc')) - if hotdoc_p.found() - if documented_projects != '' - subproject('gst-docs', default_options: 'built_subprojects=' + documented_projects) - message('Gst docs subprojects: ' + documented_projects) - endif - else + if not hotdoc_p.found() + documented_projects = '' message('Not building documentation as hotdoc was not found') endif endif +write_file_contents = ''' +import os +import sys + +assert len(sys.argv) >= 3 +fname = sys.argv[1] +contents = sys.argv[2] + +with open(fname, 'w') as f: + f.write(contents) +''' + +configure_file( + output : 'GstDocumentedSubprojects', + command : [python3, + '-c', write_file_contents, + '@OUTPUT@', + documented_projects] +) + +if documented_projects != '' + subproject('gst-docs') + message('Gst docs subprojects: ' + documented_projects) +endif + all_plugins_paths = [] foreach plugin: all_plugins all_plugins_paths += plugin.full_path()