From 82b98f7a9f77c6e3099c1685d631854c9eeb4e1f Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 18 Dec 2024 16:54:53 -0300 Subject: [PATCH] docs: Allow updating the plugins_cache.json files without generating documentation There is no dependencies between the 2 things, and it is often useful to be able to update the cache even if we are not generating the documentation Part-of: --- docs/meson.build | 15 +++++++++------ meson.build | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/meson.build b/docs/meson.build index d084ade8..df8b7806 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -1,9 +1,5 @@ build_hotdoc = false -if get_option('doc').disabled() - subdir_done() -endif - if meson.is_cross_build() if get_option('doc').enabled() error('Documentation enabled but building the doc while cross building is not supported yet.') @@ -22,7 +18,6 @@ if default_library == 'static' subdir_done() endif -required_hotdoc_extensions = ['gst-extension'] if gst_dep.type_name() == 'internal' gst_proj = subproject('gstreamer') plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') @@ -30,9 +25,12 @@ else plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-1.0' , 'gst-plugins-doc-cache-generator'), required: false) if not plugins_cache_generator.found() - plugins_cache_generator = find_program('gst-plugins-doc-cache-generator', required: false) + plugins_cache_generator = find_program('gst-plugins-doc-cache-generator', + dirs: [join_paths(gst_dep.get_variable('libexecdir', default_value: ''), 'gstreamer-' + api_version)], + required: false) endif endif + libs_doc = [] plugins_cache = join_paths(meson.current_source_dir(), 'plugins', 'gst_plugins_cache.json') if plugins.length() == 0 @@ -53,6 +51,10 @@ else warning('GStreamer plugin inspector for documentation not found, can\'t update the cache') endif +if get_option('doc').disabled() + subdir_done() +endif + hotdoc_p = find_program('hotdoc', required: get_option('doc')) if not hotdoc_p.found() message('Hotdoc not found, not building the documentation') @@ -71,6 +73,7 @@ if not hotdoc_version.version_compare(hotdoc_req) endif hotdoc = import('hotdoc') +required_hotdoc_extensions = ['gst-extension'] foreach extension: required_hotdoc_extensions if not hotdoc.has_extensions(extension) if get_option('doc').enabled() diff --git a/meson.build b/meson.build index 0c446509..fed8ee31 100644 --- a/meson.build +++ b/meson.build @@ -5,6 +5,7 @@ project('gst-plugins-rs', meson_version : '>= 1.1') # dependencies.py needs a toml parsing module +api_version = '1.0' python = import('python').find_installation(modules: ['tomllib'], required: false) if not python.found() python = import('python').find_installation(modules: ['tomli'])