File: meson.build

package info (click to toggle)
vips 8.18.0-2
  • links: PTS
  • area: main
  • in suites: forky
  • size: 53,448 kB
  • sloc: ansic: 172,621; cpp: 12,257; python: 5,077; sh: 773; perl: 40; makefile: 25; javascript: 6
file content (113 lines) | stat: -rw-r--r-- 2,685 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
gidocgen = find_program('gi-docgen')

if not enable_introspection
  error('API reference requires introspection.')
endif

docs_dir = get_option('prefix') / get_option('datadir') / 'doc'

vips_content_files = files(
  'binding.md',
  'cite.md',
  'developer-checklist.md',
  'examples.md',
  'extending.md',
  'file-format.md',
  'function-list.md',
  'how-it-opens-files.md',
  'how-it-works.md',
  'making-image-pyramids.md',
  'multipage-and-animated-images.md',
  'uhdr.md',
  'using-from-c.md',
  'using-from-cplusplus.md',
  'using-the-cli.md',
  'using-threads.md',
  'using-vipsthumbnail.md',
)

vips_section_files = files(
  'libvips-arithmetic.md',
  'libvips-basic.md',
  'libvips-colour.md',
  'libvips-conversion.md',
  'libvips-convolution.md',
  'libvips-create.md',
  'libvips-draw.md',
  'libvips-error.md',
  'libvips-freqfilt.md',
  'libvips-generate.md',
  'libvips-header.md',
  'libvips-histogram.md',
  'libvips-memory.md',
  'libvips-morphology.md',
  'libvips-mosaicing.md',
  'libvips-resample.md',
  'libvips-vips.md',
)

vips_include_dir = meson.current_build_dir() / 'libvips' / 'include'
doc_conf = configuration_data()
doc_conf.set('VIPS_VERSION', '@0@.@1@'.format(version_major, version_minor))

vips_toml = configure_file(
  input: 'vips.toml.in',
  output: 'vips.toml',
  configuration: doc_conf,
  install: true,
  install_dir: docs_dir / 'vips',
)

fixup_gir_for_doc = find_program('fixup-gir-for-doc.py')

vips_gir_doc = custom_target('vips-gir-docs',
  input: vips_gir[0],
  output: 'Vips-@0@.0-doc.gir'.format(version_major),
  command: [fixup_gir_for_doc, '@INPUT@', '@OUTPUT@'],
  depends: vips_gir[0],
)

custom_target('vips-docs',
  input: [vips_toml, vips_gir_doc],
  output: 'vips',
  command: [
    gidocgen,
    'generate',
    '--quiet',
    '--no-namespace-dir',
    '--add-include-path=@0@'.format(vips_include_dir),
    '--config=@INPUT0@',
    '--output-dir=@OUTPUT@',
    '--content-dir=@0@'.format(meson.current_source_dir()),
    '@INPUT1@',
  ],
  depends: vips_gir_doc,
  depend_files: [vips_content_files, vips_section_files],
  build_by_default: true,
  install: true,
  install_dir: docs_dir,
)

test('doc-check-gir',
  gidocgen,
  args: [
    'check',
    '--config', vips_toml,
    '--add-include-path=@0@'.format(vips_include_dir),
    vips_gir_doc,
  ],
  depends: vips_gir_doc,
  # FIXME: Remove once we have documented all public-facing symbols,
  # parameters and return values.
  should_fail: true,
  suite: ['docs'],
)

check_sections = find_program('check-sections.py')

test('doc-check-sections',
  check_sections,
  args: ['--gir', vips_gir_doc] + vips_section_files,
  depends: vips_gir_doc,
  suite: ['docs'],
)