diff options
author | Matthew Waters <matthew@centricular.com> | 2020-04-23 13:48:22 +1000 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2020-04-23 13:48:22 +1000 |
commit | b9d39e2f7f42e35af6476ba61c1f43ea53c5572a (patch) | |
tree | f7caf3f7efceca4fcd9346bfc680f67dd4bdf8fc /meson.build | |
parent | 6abaee851b921c80c393adc3e157d143e0c18f00 (diff) |
build: allow for changing subprojects with docs enabled
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/60
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/142>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/meson.build b/meson.build index c408d33..4302eef 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() |