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>
This commit is contained in:
Matthew Waters 2020-04-23 13:48:22 +10:00
parent 6abaee851b
commit b9d39e2f7f

View file

@ -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.') error('Documentation enabled but building the doc while cross building or building on windows is not supported yet.')
endif endif
documented_projects = ''
message('Documentation not built as building the documentation while cross building or building on windows is not supported yet.') message('Documentation not built as building the documentation while cross building or building on windows is not supported yet.')
else else
hotdoc_p = find_program('hotdoc', required : get_option('doc')) hotdoc_p = find_program('hotdoc', required : get_option('doc'))
if hotdoc_p.found() if not hotdoc_p.found()
if documented_projects != '' documented_projects = ''
subproject('gst-docs', default_options: 'built_subprojects=' + documented_projects)
message('Gst docs subprojects: ' + documented_projects)
endif
else
message('Not building documentation as hotdoc was not found') message('Not building documentation as hotdoc was not found')
endif endif
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 = [] all_plugins_paths = []
foreach plugin: all_plugins foreach plugin: all_plugins
all_plugins_paths += plugin.full_path() all_plugins_paths += plugin.full_path()