Skip to content

Commit 3e92093

Browse files
committed
Meson build: Add the build-manual option
1 parent 4d8093a commit 3e92093

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
@@ -454,16 +454,29 @@ if build_documentation_opt == 'if-maintainer-mode'
454454
real_build_documentation = ' (@0@)'.format(build_documentation)
455455
endif
456456

457-
validate = get_option('validation') and can_parse_and_validate
457+
explain_man = ''
458+
if build_manual_opt and not build_manual
459+
explain_man = ' (requires that documentation is built)'
460+
endif
461+
462+
validate = get_option('validation') and can_parse_and_validate and build_manual
458463
explain_val = ''
459464
if get_option('validation') and not validate
460-
explain_val = ' (requires xmllint with Relax NG and DocBook V5.0 support)'
465+
if not build_manual
466+
explain_val = ' (requires that the tutorial is built)'
467+
else
468+
explain_val = ' (requires xmllint with Relax NG and DocBook V5.0 support)'
469+
endif
461470
endif
462471

463-
build_pdf = build_pdf_by_default and can_build_pdf
472+
build_pdf = build_pdf_by_default and can_build_pdf and build_manual
464473
explain_pdf = ''
465474
if build_pdf_by_default and not build_pdf
466-
explain_pdf = ' (requires dblatex or (xsltproc and fop))'
475+
if not build_manual
476+
explain_pdf = ' (requires that the tutorial is built)'
477+
else
478+
explain_pdf = ' (requires dblatex or (xsltproc and fop))'
479+
endif
467480
endif
468481

469482
summary = [
@@ -476,6 +489,7 @@ summary = [
476489
format(cpp_warnings, warning_level, werror),
477490
' Build deprecated API: @0@'.format(build_deprecated_api),
478491
'Build HTML documentation: @0@@1@'.format(build_documentation_opt, real_build_documentation),
492+
' Build tutorial: @0@@1@'.format(build_manual, explain_man),
479493
' XML validation: @0@@1@'.format(validate, explain_val),
480494
' Build PDF: @0@@1@'.format(build_pdf, explain_pdf),
481495
' 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)