-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
executable file
·167 lines (151 loc) · 4.68 KB
/
meson.build
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
project('phosh', 'c',
version: '0.9.0',
license: 'GPLv3+',
meson_version: '>= 0.50.0',
default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ],
)
prefix = get_option('prefix')
bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
localedir = join_paths(prefix, get_option('localedir'))
libdir = join_paths(prefix, get_option('libdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
desktopdir = join_paths(datadir, 'applications')
sessiondir = join_paths(datadir, 'gnome-session')
pkgdatadir = join_paths(datadir, meson.project_name())
pkglibdir = join_paths(libdir, meson.project_name())
config_h = configuration_data()
config_h.set_quoted('GETTEXT_PACKAGE', 'phosh')
config_h.set_quoted('LOCALEDIR', localedir)
config_h.set_quoted('PHOSH_VERSION', meson.project_version())
configure_file(
input: 'config.h.in',
output: 'config.h',
configuration: config_h,
)
glib_ver = 'GLIB_VERSION_2_58'
add_project_arguments([
'-DHAVE_CONFIG_H',
'-DGLIB_VERSION_MIN_REQUIRED=@0@'.format(glib_ver),
'-DG_LOG_USE_STRUCTURED',
'-I' + meson.build_root(),
], language: 'c')
root_inc = include_directories('.')
cc = meson.get_compiler('c')
global_c_args = []
test_c_args = [
'-Wcast-align',
'-Wdate-time',
'-Wdeclaration-after-statement',
['-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',
'-Wfloat-equal',
'-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',
'-Wshadow',
'-Wstrict-prototypes',
'-Wswitch-default',
'-Wswitch-enum',
'-Wtype-limits',
'-Wundef',
'-Wunused-function',
]
if get_option('buildtype') != 'plain'
test_c_args += '-fstack-protector-strong'
endif
foreach arg: test_c_args
if cc.has_multi_arguments(arg)
global_c_args += arg
endif
endforeach
add_project_arguments(
global_c_args,
language: 'c'
)
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')
i18n = import('i18n')
gcr_dep = dependency('gcr-3', version: '>= 3.7.5')
gio_dep = dependency('gio-2.0', version: '>=2.58')
gio_unix_dep = dependency('gio-unix-2.0', version: '>=2.58')
glib_dep = dependency('glib-2.0', version: '>=2.58')
gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>=3.26')
gobject_dep = dependency('gobject-2.0', version: '>=2.50.0')
gtk_dep = dependency('gtk+-3.0', version: '>=3.22')
gtk_wayland_dep = dependency('gtk+-wayland-3.0', version: '>=3.22')
libfeedback_dep = dependency('libfeedback-0.0',
fallback: ['libfeedback', 'libfeedback_dep'],
default_options: ['introspection=disabled', 'daemon=false', 'gtk_doc=false']
)
libgvc = subproject('gvc',
default_options: [
'package_name=' + meson.project_name(),
'package_version=' + meson.project_version(),
'pkgdatadir=' + pkgdatadir,
'pkglibdir=' + pkglibdir,
'static=true',
'introspection=false',
'alsa=false'
])
libgvc_dep = libgvc.get_variable('libgvc_dep')
libhandy_dep = dependency('libhandy-1',
version: '>=1.1.90',
fallback: ['libhandy', 'libhandy_dep'],
default_options: ['introspection=disabled']
)
libnm_dep = dependency('libnm', version: '>= 1.14')
libpolkit_agent_dep = dependency('polkit-agent-1', version: '>= 0.105')
# TODO: make optional for elogind?
libsystemd_dep = dependency('libsystemd', version: '>= 241')
network_agent_dep = dependency('libsecret-1')
upower_glib_dep = dependency('upower-glib', version: '>=0.99.1')
wayland_client_dep = dependency('wayland-client', version: '>=1.14')
wayland_protos_dep = dependency('wayland-protocols', version: '>=1.12')
meson.add_install_script(
join_paths('build-aux', 'post_install.py'),
datadir
)
subdir('data')
subdir('po')
subdir('protocol')
subdir('src')
subdir('tools')
subdir('tests')
subdir('docs')
summary = [
'',
'-----------',
'Phosh @0@'.format(meson.project_version()),
'',
' Tests: @0@'.format(get_option('tests')),
' Phoc Tests: @0@'.format(run_phoc_tests),
'Documentation: @0@'.format(get_option('gtk_doc')),
'-----------',
]
message('\n'.join(summary))