summaryrefslogtreecommitdiff
path: root/lib/meson.build
blob: 473ac627cb24431b415895383173d4da3b391a49 (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
project('foobar', 'c', default_options: ['c_std=gnu11', 'warning_level=1'])

gnome = import('gnome')
glib_dep = dependency('glib-2.0', version: '>=2.78')
gio_dep = dependency('gio-2.0', version: '>=2.78')

deps = [
  glib_dep,
  gio_dep,
]

sources = []

sources += gnome.gdbus_codegen(
  'server',
  'dbus/com.github.hannesschulze.foobar.xml',
  namespace: 'Foobar',
  annotations: [
    ['com.github.hannesschulze.foobar.Server', 'org.gtk.GDBus.C.Name', 'Server'],
  ],
)

sources += gnome.gdbus_codegen(
  'notifications',
  'dbus/org.freedesktop.Notifications.xml',
  namespace: 'Foobar',
  annotations: [
    ['org.freedesktop.Notifications', 'org.gtk.GDBus.C.Name', 'Notifications'],
  ],
)

sources += gnome.gdbus_codegen(
  'upower',
  'dbus/org.freedesktop.UPower.xml',
  namespace: 'Foobar',
  annotations: [
    ['org.freedesktop.UPower.Device', 'org.gtk.GDBus.C.Name', 'UPowerDevice'],
  ],
)

sources += gnome.gdbus_codegen(
  'bluez',
  'dbus/org.bluez.xml',
  namespace: 'Foobar',
  annotations: [
    ['org.bluez.Adapter1', 'org.gtk.GDBus.C.Name', 'BluezAdapter'],
    ['org.bluez.Device1', 'org.gtk.GDBus.C.Name', 'BluezDevice'],
    ['org.bluez.AgentManager1', 'org.gtk.GDBus.C.Name', 'BluezAgentManager'],
  ],
)

c_args = [
  '-Wall',
  '-Werror',
  '-Wswitch-enum',
  '-Wswitch-default',
  '-Wunused',
  '-Wuninitialized',
]

static_library(
  'foobar_static',
  sources,
  dependencies: deps,
  install: false,
  c_args: c_args
)

libfoobar = shared_library(
  'foobar',
  sources,
  dependencies: deps,
  install: false,
  c_args: c_args
)

libfoobar_gir = gnome.generate_gir(
  libfoobar,
  sources: sources,
  namespace: 'Foobar',
  link_with: libfoobar,
  nsversion: '1.0.0',
  identifier_prefix: 'Foobar',
  symbol_prefix: 'foobar',
  export_packages: 'foobar',
  dependencies: deps,
  includes: [ 'GObject-2.0', 'Gio-2.0' ],
  install: false,
  extra_args: [ '--fallback-library-path=' ]
)