summaryrefslogtreecommitdiff
path: root/headers/meson.build
blob: 2aed919407e4873e0ddf1c7736d1c178797c7b23 (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
headers = files(
  'gdesktop-enums.h'
)

install_headers(headers, subdir: gsettings_desktop_schemas_name)

enums_xml = custom_target(
  'org.gnome.desktop.enums.xml',
  input: headers,
  output: 'org.gnome.desktop.enums.xml',
  command: [glib_mkenums,
            '--comments', '<!-- @comment@ -->',
            '--fhead', '<schemalist>',
            '--vhead', '<@type@ id="org.gnome.desktop.@EnumName@">',
            '--vprod', '    <value nick="@valuenick@" value="@valuenum@"/>',
            '--vtail', '  </@type@>',
            '--ftail', '</schemalist>', '@INPUT@'],
  capture: true,
  install: true,
  install_dir: schemasdir)

if get_option('introspection')
  gir_sources = headers

  # Use a dummy .c source for Visual Studio builds-it is not enough
  # to send in just a header file to build a dummy library on MSVC
  if cc.get_id() == 'msvc'
    gir_sources += ['dummy-msvc.c']
  endif

  noinst_lib = shared_library('noinst',
                              gir_sources,
                              install: false)

  gnome.generate_gir(noinst_lib,
    sources: headers,
    namespace: 'GDesktopEnums',
    identifier_prefix: 'GDesktop',
    nsversion : '3.0',
    install: true,
    extra_args: [
      '--header-only',
    ]
  )
endif