summaryrefslogtreecommitdiff
path: root/docs/meson.build
blob: f2aeb76d6339287d7798dcac4075fac226f963e8 (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
if get_option('gtk_doc') and get_option('introspection')
  dependency('gi-docgen', version: '>= 2021.6',
    fallback: ['gi-docgen', 'dummy_dep'],
  )

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

  rest_docdir = rest_datadir / 'doc'

  toml_conf = configuration_data()
  toml_conf.set('REST_VERSION', meson.project_version())
  toml_conf.set('SOUP_VERSION', libsoup_api_version)

  rest_toml = configure_file(
    input: 'librest.toml.in',
    output: 'librest.toml',
    configuration: toml_conf,
  )

  custom_target('librest-doc',
    input: librest_gir[0],
    output: 'librest-1.0',
    command: [
      gidocgen,
      'generate',
      '--quiet',
      '--fatal-warnings',
      '--add-include-path=@0@'.format(meson.current_build_dir() / '../rest'),
      '--config', rest_toml,
      '--output-dir=@OUTPUT@',
      '--no-namespace-dir',
      '--content-dir=@0@'.format(meson.current_source_dir()),
      '@INPUT@',
    ],
    depend_files: [ rest_toml ],
    build_by_default: true,
    install: true,
    install_dir: rest_docdir,
  )

  # if get_option('tests')
  #   test('doc-check',
  #     gidocgen,
  #     args: [
  #       'check',
  #       '--config', rest_toml,
  #       '--add-include-path=@0@'.format(meson.current_build_dir() / '../rest'),
  #       librest_gir[0],
  #     ],
  #     depends: librest_gir[0],
  #     suite: ['docs'],
  #   )
  # endif

endif