configure, meson, devel-docs: make gi-docgen into an auto option.

Also called "feature" option in meson, so that by default it depends on
auto-detection of the gi-docgen hence won't break the configuration when
the tool is missing (the feature is simply disabled).

Also move the program check into the root meson file, which is anyway
much better to have a better visibility of features, otherwise we'd end
up just having tests everywhere in any possible random directory of the
repo.

Finally add a line in the summary of the configuration step, displaying
the docs generation being enabled or disabled.
This commit is contained in:
Jehan 2021-12-29 00:55:17 +01:00
parent 7473b24492
commit d5e22ad313
5 changed files with 18 additions and 8 deletions

View File

@ -2752,13 +2752,21 @@ fi
# Check for gi-docgen
########################################
AC_ARG_ENABLE(gi-docgen, [ --enable-gi-docgen build gi-docgen documentation (default=yes)], , enable_gi_docgen=yes)
AC_ARG_ENABLE(gi-docgen, [ --enable-gi-docgen build gi-docgen documentation (default=auto)], , enable_gi_docgen=auto)
if test "x$enable_gi_docgen" = xyes; then
if test "x$enable_gi_docgen" != xno; then
AC_PATH_PROG(GI_DOCGEN, gi-docgen, no)
if test "x$GI_DOCGEN" = xno; then
add_deps_error([gi-docgen], [Could not find gi-docgen in your PATH.])
if test "x$enable_gi_docgen" = xyes; then
add_deps_error([gi-docgen], [Could not find gi-docgen in your PATH.])
else
enable_gi_docgen="no (gi-docgen missing)"
fi
else
enable_gi_docgen="yes"
fi
else
enable_gi_docgen="no"
fi
AM_CONDITIONAL(ENABLE_GI_DOCGEN, test "x$enable_gi_docgen" = xyes)
@ -3272,6 +3280,7 @@ Tests:
Test desktop file $have_desktop_file_validate
Documentation:
libgimp API Reference: $enable_gi_docgen
GObject Introspection: $enable_g_ir_doc
Bug report URL: $with_bug_report_url

View File

@ -16,8 +16,7 @@ mkdb_args_common = [
'--name-space=gimp',
]
if get_option('gi-docgen')
if gi_docgen.found()
subdir('reference')
endif

View File

@ -1,4 +1,2 @@
gi_docgen = find_program('gi-docgen')
subdir('gimp')
subdir('gimp-ui')

View File

@ -1009,6 +1009,9 @@ desktop_validate = find_program('desktop-file-validate', required: false)
appstream_util = find_program('appstream-util', required: get_option('appdata-test'))
# Check for doc generation tools
gi_docgen = find_program('gi-docgen', required: get_option('gi-docgen'))
if get_option('g-ir-doc')
gir_doc_tool = find_program('g-ir-doc-tool', required: true)
yelp_build = find_program('yelp-build', required: true)
@ -1828,6 +1831,7 @@ final_message = [
''' Test appdata @0@'''.format(appstream_util.found()),
'',
'''Documentation:''',
''' libgimp API Reference: @0@'''.format(gi_docgen.found()),
''' GObject Introspection: @0@'''.format(get_option('g-ir-doc')),
'',
'''Bug report URL: @0@'''.format(bug_report_url),

View File

@ -51,7 +51,7 @@ option('xcursor', type: 'feature', value: 'auto', description: 'Xcurso
option('xpm', type: 'feature', value: 'auto', description: 'XPM support')
option('headless-tests', type: 'feature', value: 'auto', description: 'Use xvfb-run/dbus-run-session for UI-dependent automatic tests')
option('gi-docgen', type: 'boolean', value: true, description: 'Build developer documentation (uses gi-docgen)')
option('gi-docgen', type: 'feature', value: 'auto', description: 'Build developer documentation (uses gi-docgen)')
option('g-ir-doc', type: 'boolean', value: false, description: 'Build developer documentation for introspected API')
option('linux-input', type: 'feature', value: 'auto', description: 'Linux input event controller module')