Skip to content

Commit 2f49ec7

Browse files
committed
Merge branch 'ps/meson-build-docs'
The build procedure based on meson learned a target to only build documentation, similar to "make doc". * ps/meson-build-docs: ci: don't compile whole project when testing docs with Meson meson: print docs backend as part of the summary meson: introduce a "docs" alias to compile documentation only
2 parents 2ddbf14 + ff4ec8d commit 2f49ec7

File tree

7 files changed

+24
-14
lines changed

7 files changed

+24
-14
lines changed

Documentation/howto/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ howto_index = custom_target(
2929
output: 'howto-index.adoc',
3030
)
3131

32-
custom_target(
32+
doc_targets += custom_target(
3333
command: asciidoc_html_options,
3434
input: howto_index,
3535
output: 'howto-index.html',
@@ -51,7 +51,7 @@ foreach howto : howto_sources
5151
capture: true,
5252
)
5353

54-
custom_target(
54+
doc_targets += custom_target(
5555
command: asciidoc_html_options,
5656
input: howto_stripped,
5757
output: fs.stem(howto_stripped.full_path()) + '.html',

Documentation/meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ foreach manpage, category : manpages
377377
output: fs.stem(manpage) + '.xml',
378378
)
379379

380-
custom_target(
380+
doc_targets += custom_target(
381381
command: [
382382
xmlto,
383383
'-m', '@INPUT0@',
@@ -400,7 +400,7 @@ foreach manpage, category : manpages
400400
endif
401401

402402
if get_option('docs').contains('html')
403-
custom_target(
403+
doc_targets += custom_target(
404404
command: asciidoc_common_options + [
405405
'--backend=' + asciidoc_html,
406406
'--doctype=manpage',
@@ -452,7 +452,7 @@ if get_option('docs').contains('html')
452452
depends: documentation_deps,
453453
)
454454

455-
custom_target(
455+
doc_targets += custom_target(
456456
command: [
457457
xsltproc,
458458
'--xinclude',
@@ -481,7 +481,7 @@ if get_option('docs').contains('html')
481481
]
482482

483483
foreach article : articles
484-
custom_target(
484+
doc_targets += custom_target(
485485
command: asciidoc_common_options + [
486486
'--backend=' + asciidoc_html,
487487
'--out-file=@OUTPUT@',

Documentation/technical/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ api_index = custom_target(
4646
output: 'api-index.adoc',
4747
)
4848

49-
custom_target(
49+
doc_targets += custom_target(
5050
command: asciidoc_html_options,
5151
input: api_index,
5252
output: 'api-index.html',
@@ -56,7 +56,7 @@ custom_target(
5656
)
5757

5858
foreach article : api_docs + articles
59-
custom_target(
59+
doc_targets += custom_target(
6060
command: asciidoc_html_options,
6161
input: article,
6262
output: fs.stem(article) + '.html',

ci/test-documentation.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ check_unignored_build_artifacts
4848

4949
# Build docs with Meson and AsciiDoc
5050
meson setup build-asciidoc -Ddocs=html,man -Ddocs_backend=asciidoc
51-
meson compile -C build-asciidoc
51+
meson compile -C build-asciidoc docs
5252
check_docs build-asciidoc AsciiDoc
5353
rm -rf build-asciidoc
5454

5555
# Build docs with Meson and AsciiDoctor
5656
meson setup build-asciidoctor -Ddocs=html,man -Ddocs_backend=asciidoctor
57-
meson compile -C build-asciidoctor
57+
meson compile -C build-asciidoctor docs
5858
check_docs build-asciidoctor Asciidoctor
5959
rm -rf build-asciidoctor
6060

contrib/contacts/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if get_option('docs').contains('man')
2020
output: 'git-contacts.xml',
2121
)
2222

23-
custom_target(
23+
doc_targets += custom_target(
2424
command: [
2525
xmlto,
2626
'-m', '@INPUT@',
@@ -39,7 +39,7 @@ if get_option('docs').contains('man')
3939
endif
4040

4141
if get_option('docs').contains('html')
42-
custom_target(
42+
doc_targets += custom_target(
4343
command: asciidoc_common_options + [
4444
'--backend=' + asciidoc_html,
4545
'--doctype=manpage',

contrib/subtree/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if get_option('docs').contains('man')
3838
output: 'git-subtree.xml',
3939
)
4040

41-
custom_target(
41+
doc_targets += custom_target(
4242
command: [
4343
xmlto,
4444
'-m', '@INPUT@',
@@ -57,7 +57,7 @@ if get_option('docs').contains('man')
5757
endif
5858

5959
if get_option('docs').contains('html')
60-
custom_target(
60+
doc_targets += custom_target(
6161
command: asciidoc_common_options + [
6262
'--backend=' + asciidoc_html,
6363
'--doctype=manpage',

meson.build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,11 +2101,20 @@ endif
21012101

21022102
subdir('bin-wrappers')
21032103
if get_option('docs') != []
2104+
doc_targets = []
21042105
subdir('Documentation')
2106+
else
2107+
docs_backend = 'none'
21052108
endif
21062109

21072110
subdir('contrib')
21082111

2112+
# Note that the target is intentionally configured after including the
2113+
# 'contrib' directory, as some tool there also have their own manpages.
2114+
if get_option('docs') != []
2115+
alias_target('docs', doc_targets)
2116+
endif
2117+
21092118
exclude_from_check_headers = [
21102119
'compat/',
21112120
'unicode-width.h',
@@ -2244,6 +2253,7 @@ summary({
22442253

22452254
summary({
22462255
'csprng': csprng_backend,
2256+
'docs': docs_backend,
22472257
'https': https_backend,
22482258
'sha1': sha1_backend,
22492259
'sha1_unsafe': sha1_unsafe_backend,

0 commit comments

Comments
 (0)