summaryrefslogtreecommitdiff
path: root/rest-extras/meson.build
blob: 67e6fd034eecb6468575a93e52dd3b7c7c4e6e2f (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
librest_extras_pkg_string = 'rest-extras-@0@'.format(librest_api_version)

librest_extras_sources = [
  'flickr-proxy.c',
  'flickr-proxy-call.c',
  'lastfm-proxy.c',
  'lastfm-proxy-call.c',
  'youtube-proxy.c',
]

librest_extras_headers = [
  'flickr-proxy.h',
  'flickr-proxy-call.h',
  'lastfm-proxy.h',
  'lastfm-proxy-call.h',
  'youtube-proxy.h',
]

librest_extras_deps = [
  glib_dep,
  libsoup_dep,
  libxml_dep,
  librest_dep,
]

librest_extras_c_args = [
  '-DG_LOG_DOMAIN="Rest"',
]

librest_extras_lib = library(librest_extras_pkg_string,
  librest_extras_sources,
  dependencies: librest_extras_deps,
  c_args: librest_extras_c_args,
  include_directories: config_h_inc,
  version: librest_module_version,
  soversion: librest_soversion,
  install: true,
)

install_headers(librest_extras_headers,
  subdir: librest_pkg_string / 'rest-extras',
)

librest_extras_dep = declare_dependency(
  link_with: librest_extras_lib,
)

if get_option('vapi') and not get_option('introspection')
  warning('Vapi generation needs "introspection" option in order to generate the .vapi file')
endif

if get_option('introspection')
  librest_extras_gir = gnome.generate_gir(librest_extras_lib,
    sources: librest_extras_sources + librest_extras_headers,
    namespace: 'RestExtras',
    symbol_prefix: 'rest_extras',
    identifier_prefix: 'RestExtras',
    nsversion: librest_api_version,
    includes: [ 'GObject-2.0', 'Gio-2.0', 'Soup-@0@'.format(libsoup_api_version), librest_gir[0] ],
    extra_args: [ '--accept-unprefixed' ],
    dependencies: librest_extras_deps,
    install: true,
  )
  
  if get_option('vapi')
    librest_extras_vapi = gnome.generate_vapi(librest_extras_pkg_string,
      sources: librest_extras_gir [0],
      packages: [ 'glib-2.0', 'libsoup-@0@'.format(libsoup_api_version), librest_vapi ],
      install: true,
    )
  endif
endif

# Test suite
test_runner_c_args = [
  '-DBUILD_TESTS',
]

test_runner_bin = executable('test-runner',
  [ 'test-runner.c', librest_extras_sources ],
  dependencies: librest_extras_deps,
  c_args: test_runner_c_args,
  include_directories: config_h_inc,
)

test('test-runner', test_runner_bin,
  suite: 'rest-extras',
)