Skip to content

Commit 353f8b3

Browse files
committed
Meson build: Add the build-manual option
1 parent 1df7026 commit 353f8b3

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

docs/manual/meson.build

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
# input: install_datadir, xmlxx_pcname, tutorial_custom_cmd_py, python3,
44
# build_documentation, book_name, can_add_dist_script, xsltproc
55
# output: can_parse_and_validate, build_pdf_by_default, can_build_pdf,
6-
# install_tutorialdir
6+
# install_tutorialdir, build_manual_opt, build_manual
77

8-
xmllint = find_program('xmllint', required: false)
8+
build_manual_opt = get_option('build-manual')
9+
build_manual = build_manual_opt and build_documentation
910

11+
xmllint = find_program('xmllint', required: false)
1012
can_parse_and_validate = xmllint.found()
11-
1213
validate = get_option('validation') ? 'true' : 'false'
1314

1415
dblatex = find_program('dblatex', required: false)
@@ -19,8 +20,8 @@ build_pdf_by_default = get_option('build-pdf')
1920
# Installation directories are relative to {prefix}.
2021
install_tutorialdir = install_datadir / 'doc' / book_name / 'manual'
2122

22-
if not build_documentation
23-
# Documentation shall not be built or installed.
23+
if not build_manual
24+
# The manual shall not be built or installed.
2425
# Return to the calling meson.build file.
2526
subdir_done()
2627
endif

meson.build

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,16 +461,29 @@ if build_documentation_opt == 'if-maintainer-mode'
461461
real_build_documentation = ' (@0@)'.format(build_documentation)
462462
endif
463463

464-
validate = get_option('validation') and can_parse_and_validate
464+
explain_man = ''
465+
if build_manual_opt and not build_manual
466+
explain_man = ' (requires that documentation is built)'
467+
endif
468+
469+
validate = get_option('validation') and can_parse_and_validate and build_manual
465470
explain_val = ''
466471
if get_option('validation') and not validate
467-
explain_val = ' (requires xmllint with Relax NG and DocBook V5.0 support)'
472+
if not build_manual
473+
explain_val = ' (requires that the tutorial is built)'
474+
else
475+
explain_val = ' (requires xmllint with Relax NG and DocBook V5.0 support)'
476+
endif
468477
endif
469478

470-
build_pdf = build_pdf_by_default and can_build_pdf
479+
build_pdf = build_pdf_by_default and can_build_pdf and build_manual
471480
explain_pdf = ''
472481
if build_pdf_by_default and not build_pdf
473-
explain_pdf = ' (requires dblatex or (xsltproc and fop))'
482+
if not build_manual
483+
explain_pdf = ' (requires that the tutorial is built)'
484+
else
485+
explain_pdf = ' (requires dblatex or (xsltproc and fop))'
486+
endif
474487
endif
475488

476489
summary = [
@@ -483,6 +496,7 @@ summary = [
483496
format(cpp_warnings, warning_level, werror),
484497
' Build deprecated API: @0@'.format(build_deprecated_api),
485498
'Build HTML documentation: @0@@1@'.format(build_documentation_opt, real_build_documentation),
499+
' Build tutorial: @0@@1@'.format(build_manual, explain_man),
486500
' XML validation: @0@@1@'.format(validate, explain_val),
487501
' Build PDF: @0@@1@'.format(build_pdf, explain_pdf),
488502
' Build example programs: @0@'.format(build_examples),

meson_options.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ option('build-deprecated-api', type: 'boolean', value: true,
88
description: 'Build deprecated API and include it in the library')
99
option('build-documentation', type: 'combo', choices: ['false', 'if-maintainer-mode', 'true'],
1010
value: 'if-maintainer-mode', description: 'Build and install the documentation')
11+
option('build-manual', type: 'boolean', value: true,
12+
description: 'Build tutorial HTML files, if documentation is built')
1113
option('validation', type: 'boolean', value: true,
12-
description: 'Validate the tutorial XML file')
14+
description: 'Validate the tutorial XML file, if tutorial HTML files are built')
1315
option('build-pdf', type: 'boolean', value: false,
14-
description: 'Build tutorial PDF file')
16+
description: 'Build tutorial PDF file, if tutorial HTML files are built')
1517
option('build-examples', type: 'boolean', value: true,
1618
description: 'Build example programs')
1719
option('build-tests', type: 'boolean', value: true,

0 commit comments

Comments
 (0)