Add a meson flag to make cool URIs optional

The script `ensure-stable-doc-urls.py` relies on the Doxygen output files
names. These may change between Doxygen versions, although the Doxygen
developers intend stability.

Since the script is useful mainly for the online documentation of
xkbcommon, make the target `doc-cool-uris` optional.
master
Pierre Le Marre 2023-06-27 20:31:01 +02:00 committed by Wismill
parent fc25e0f0f7
commit 37fdd87c82
2 changed files with 22 additions and 14 deletions

View File

@ -833,20 +833,22 @@ You can disable the documentation with -Denable-docs=false.''')
install_dir: docdir, install_dir: docdir,
build_by_default: true, build_by_default: true,
) )
ensure_stable_urls = find_program('scripts'/'ensure-stable-doc-urls.py') if get_option('enable-cool-uris')
custom_target( ensure_stable_urls = find_program('scripts'/'ensure-stable-doc-urls.py')
'doc-cool-uris', custom_target(
input: [doc_gen, 'doc'/'cool-uris.yaml'], 'doc-cool-uris',
output: 'html-xtra', input: [doc_gen, 'doc'/'cool-uris.yaml'],
command: [ output: 'html-xtra',
ensure_stable_urls, command: [
'generate-redirections', ensure_stable_urls,
meson.current_source_dir()/'doc'/'cool-uris.yaml', 'generate-redirections',
meson.current_build_dir()/'html' meson.current_source_dir()/'doc'/'cool-uris.yaml',
], meson.current_build_dir()/'html'
install: false, ],
build_by_default: true, install: false,
) build_by_default: true,
)
endif
endif endif
configure_file(output: 'config.h', configuration: configh_data) configure_file(output: 'config.h', configuration: configh_data)

View File

@ -61,6 +61,12 @@ option(
value: true, value: true,
description: 'Enable building the documentation', description: 'Enable building the documentation',
) )
option(
'enable-cool-uris',
type: 'boolean',
value: false,
description: 'Enable creating redirections to maintain stable documentation pages',
)
option( option(
'enable-wayland', 'enable-wayland',
type: 'boolean', type: 'boolean',