File: meson.build

package info (click to toggle)
feedbackd 0.8.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,068 kB
  • sloc: ansic: 7,926; xml: 97; makefile: 31; sh: 27; python: 8
file content (134 lines) | stat: -rw-r--r-- 4,168 bytes parent folder | download
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
project(
  'feedbackd',
  'c',
  version: '0.8.8',
  license: 'LGPLv3+',
  meson_version: '>= 1.1.0',
  default_options: ['warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11'],
)

gio = dependency('gio-2.0', version: '>=2.50.0')
gio_unix = dependency('gio-unix-2.0', version: '>=2.50.0')
glib = dependency('glib-2.0', version: '>=2.50.0')
udev = dependency('udev', required: false)
if get_option('daemon')
  gobject = dependency('gobject-2.0', version: '>=2.50.0')
  gmobile = dependency(
    'gmobile',
    version: '>= 0.1.0',
    fallback: ['gmobile', 'gmobile_dep'],
    default_options: ['examples=false', 'introspection=false', 'gtk_doc=false', 'tests=false'],
  )
  gsound = dependency('gsound')
  gudev = dependency('gudev-1.0', version: '>=232')
  json_glib = dependency('json-glib-1.0')
  systemd_dep = dependency('systemd', required: false)
endif

prefix = get_option('prefix')

bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
libdir = join_paths(prefix, get_option('libdir'))
girdir = join_paths(prefix, join_paths(datadir, 'gir-1.0'))
ifacedir = join_paths(prefix, join_paths(datadir, 'dbus-1', 'interfaces'))
servicedir = join_paths(prefix, join_paths(datadir, 'dbus-1', 'services'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
typelibdir = join_paths(prefix, join_paths(libdir, 'girepository-1.0'))
vapidir = join_paths(prefix, join_paths(datadir, 'vala', 'vapi'))
feedbackd_theme_dir = join_paths(datadir, 'feedbackd', 'themes')
if udev.found() and get_option('daemon')
  udevdir = udev.get_variable('udevdir') / 'rules.d'
else
  udevdir = prefix / 'lib' / 'udev' / 'rules.d'
endif
wireplumberdir = datadir / 'wireplumber' / 'wireplumber.conf.d'

run_data = configuration_data()
run_data.set('ABS_BUILDDIR', meson.current_build_dir())
run_data.set('ABS_SRCDIR', meson.current_source_dir())
configure_file(input: 'run.in', output: 'run', configuration: run_data)

gnome = import('gnome')

cc = meson.get_compiler('c')

test_c_args = [
  '-Wcast-align',
  '-Wdate-time',
  ['-Werror=format-security', '-Werror=format=2'],
  '-Wendif-labels',
  '-Werror=incompatible-pointer-types',
  '-Werror=missing-declarations',
  '-Werror=overflow',
  '-Werror=return-type',
  '-Werror=shift-count-overflow',
  '-Werror=shift-overflow=2',
  '-Werror=implicit-fallthrough=3',
  '-Wformat-nonliteral',
  '-Wformat-security',
  '-Winit-self',
  '-Wmaybe-uninitialized',
  '-Wmissing-field-initializers',
  '-Wmissing-include-dirs',
  '-Wmissing-noreturn',
  '-Wnested-externs',
  '-Wno-missing-field-initializers',
  '-Wno-sign-compare',
  '-Wno-strict-aliasing',
  '-Wno-unused-parameter',
  '-Wold-style-definition',
  '-Wpointer-arith',
  '-Wredundant-decls',
  '-Wstrict-prototypes',
  '-Wtype-limits',
  '-Wundef',
  '-Wunused-function',
]

if get_option('buildtype') != 'plain'
  test_c_args += '-fstack-protector-strong'
endif

global_c_args = [
  '-DFEEDBACKD_THEME_DIR="@0@"'.format(feedbackd_theme_dir),
  '-DLIBFEEDBACK_COMPILATION',
  '-DFBD_VERSION="@0@"'.format(meson.project_version()),
]

add_project_arguments(global_c_args + cc.get_supported_arguments(test_c_args), language: 'c')

introspection_feature = get_option('introspection')
introspection = introspection_feature.enabled() or introspection_feature.auto()

apiversion = '0.0'
libname = 'libfeedback-' + apiversion

json_glib_validate = find_program('json-glib-validate', required: false)

subdir('data')
subdir('libfeedback')
subdir('src')
subdir('cli')
subdir('tests')
subdir('doc')

summary = [
  '',
  '---------------',
  'feedbackd @0@'.format(meson.project_version()),
  '',
  '         Daemon: @0@'.format(get_option('daemon')),
  '     Udev rules: @0@'.format(get_option('udev')),
  '  Documentation: @0@'.format(get_option('gtk_doc')),
  '   Manual pages: @0@'.format(get_option('man')),
  '  Introspection: @0@'.format(introspection),
  '           Vapi: @0@'.format(get_option('vapi')),
  '          Tests: @0@'.format(get_option('tests')),
  '    Media Roles: @0@'.format(get_option('media-roles')),
  '---------------',
  '',
]
message('\n'.join(summary))

gnome.post_install(glib_compile_schemas: true)