Skip to content

Commit 2a8bd34

Browse files
pks-tgitster
authored andcommitted
meson: properly wire up dependencies for our docs
A couple of Meson documentation targets use `meson.current_source_dir()` to resolve inputs. This has the downside that it does not automagically make Meson track these inputs as a dependency. After all, string arguments really can be anything, even if they happen to match an actual filesystem path. Adapt these build targets to instead use inputs. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d838d82 commit 2a8bd34

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Documentation/meson.build

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ if docs_backend == 'asciidoc'
229229
'@INPUT@',
230230
'@OUTPUT@',
231231
],
232-
input: meson.current_source_dir() / 'asciidoc.conf.in',
232+
input: 'asciidoc.conf.in',
233233
output: 'asciidoc.conf',
234234
depends: [git_version_file],
235235
env: version_gen_environment,
@@ -261,7 +261,7 @@ elif docs_backend == 'asciidoctor'
261261
'@INPUT@',
262262
'@OUTPUT@',
263263
],
264-
input: meson.current_source_dir() / 'asciidoctor-extensions.rb.in',
264+
input: 'asciidoctor-extensions.rb.in',
265265
output: 'asciidoctor-extensions.rb',
266266
depends: [git_version_file],
267267
env: version_gen_environment,
@@ -304,18 +304,19 @@ cmd_lists = [
304304
documentation_deps += custom_target(
305305
command: [
306306
perl,
307-
meson.current_source_dir() / 'cmd-list.perl',
307+
'@INPUT@',
308308
meson.project_source_root(),
309309
meson.current_build_dir(),
310310
] + cmd_lists,
311+
input: 'cmd-list.perl',
311312
output: cmd_lists
312313
)
313314

314315
foreach mode : [ 'diff', 'merge' ]
315316
documentation_deps += custom_target(
316317
command: [
317318
shell,
318-
meson.current_source_dir() / 'generate-mergetool-list.sh',
319+
'@INPUT@',
319320
'..',
320321
'diff',
321322
'@OUTPUT@'
@@ -324,6 +325,7 @@ foreach mode : [ 'diff', 'merge' ]
324325
'MERGE_TOOLS_DIR=' + meson.project_source_root() / 'mergetools',
325326
'TOOL_MODE=' + mode,
326327
],
328+
input: 'generate-mergetool-list.sh',
327329
output: 'mergetools-' + mode + '.txt',
328330
)
329331
endforeach
@@ -335,27 +337,30 @@ foreach manpage, category : manpages
335337
'--backend=' + asciidoc_docbook,
336338
'--doctype=manpage',
337339
'--out-file=@OUTPUT@',
338-
meson.current_source_dir() / manpage,
340+
'@INPUT@',
339341
],
340342
depends: documentation_deps,
343+
input: manpage,
341344
output: fs.stem(manpage) + '.xml',
342345
)
343346

344347
manpage_path = fs.stem(manpage) + '.' + category.to_string()
345348
manpage_target = custom_target(
346349
command: [
347350
xmlto,
348-
'-m',
349-
meson.current_source_dir() / 'manpage-normal.xsl',
350-
'-m',
351-
meson.current_source_dir() / 'manpage-bold-literal.xsl',
351+
'-m', '@INPUT0@',
352+
'-m', '@INPUT1@',
352353
'--stringparam',
353354
'man.base.url.for.relative.links=' + get_option('prefix') / get_option('mandir'),
354355
'man',
355356
manpage_xml_target,
356357
'-o',
357358
meson.current_build_dir(),
358359
] + xmlto_extra,
360+
input: [
361+
'manpage-normal.xsl',
362+
'manpage-bold-literal.xsl',
363+
],
359364
output: manpage_path,
360365
install: true,
361366
install_dir: get_option('mandir') / 'man' + category.to_string(),
@@ -368,9 +373,10 @@ foreach manpage, category : manpages
368373
'--backend=' + asciidoc_html,
369374
'--doctype=manpage',
370375
'--out-file=@OUTPUT@',
371-
meson.current_source_dir() / manpage,
376+
'@INPUT@',
372377
],
373378
depends: documentation_deps,
379+
input: manpage,
374380
output: fs.stem(manpage) + '.html',
375381
install: true,
376382
install_dir: get_option('datadir') / 'doc/git-doc',

0 commit comments

Comments
 (0)