summaryrefslogtreecommitdiff
path: root/doc/reference/meson.build
blob: beffb32245282e92397796a094e4159c6f842963 (plain)
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
# Copyright © 2021, 2022 Christian Persch
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library.  If not, see <https://www.gnu.org/licenses/>.

assert(get_option('gir'), 'Introspection must be enabled to build docs')

gidocgen = find_program('gi-docgen', required: true)

doc_conf = configuration_data()
doc_conf.set('version', meson.project_version())

doc_sources = [
  'licence.md',
]

docdir = vte_datadir / 'doc'

if get_option('gtk3')

  libvte_gtk3_docs_toml = configure_file(
    configuration: doc_conf,
    input: 'vte-gtk3.toml.in',
    install: true,
    install_dir: docdir / vte_gtk3_api_name,
    output: vte_gtk3_api_name + '.toml',
  )

  libvte_gtk3_docs = custom_target(
    vte_gtk3_api_name,
    command: [
      gidocgen,
      'generate',
      '--config', '@INPUT0@',
      '--content-dir', meson.current_source_dir(),
      '--fatal-warnings',
      '--no-namespace-dir',
      '--output-dir', '@OUTPUT@',
      '--quiet',
      '@INPUT1@',
    ],
    depend_files: [doc_sources,],
    input: [
      libvte_gtk3_docs_toml,
      libvte_gtk3_gir[0],
    ],
    install: true,
    install_dir: docdir,
    output: vte_gtk3_api_name,
  )

endif # gtk3

if get_option('gtk4')

  libvte_gtk4_docs_toml = configure_file(
    configuration: doc_conf,
    input: 'vte-gtk4.toml.in',
    install: true,
    install_dir: docdir / vte_gtk4_api_name,
    output: vte_gtk4_api_name + '.toml',
  )

  libvte_gtk4_docs = custom_target(
    vte_gtk4_api_name,
    command: [
      gidocgen,
      'generate',
      '--config', '@INPUT0@',
      '--content-dir', meson.current_source_dir(),
      '--fatal-warnings',
      '--no-namespace-dir',
      '--output-dir', '@OUTPUT@',
      '--quiet',
      '@INPUT1@',
    ],
    depend_files: [doc_sources,],
    input: [
      libvte_gtk4_docs_toml,
      libvte_gtk4_gir[0],
    ],
    install: true,
    install_dir: docdir,
    output: vte_gtk4_api_name,
  )

endif # gtk4