forked from linuxmint/cinnamon-control-center
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
197 lines (160 loc) · 6.38 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
project('cinnamon-control-center', 'c',
version: '5.2.1',
meson_version: '>=0.49.0',
)
i18n = import('i18n')
pkgconfig = import('pkgconfig')
gnome = import('gnome')
cc = meson.get_compiler('c')
config = configuration_data()
###############################################################################
# Project conf
lib_ver = '1.0.0'
gettext_package = meson.project_name()
config.set_quoted('PACKAGE', meson.project_name())
config.set_quoted('VERSION', meson.project_version())
config.set_quoted('GETTEXT_PACKAGE', gettext_package)
###############################################################################
# Dependencies
math = cc.find_library('m')
cinn_desktop= dependency('cinnamon-desktop', version: '>=4.6.0')
cinn_menu = dependency('libcinnamon-menu-3.0')
gtk = dependency('gtk+-3.0', version: '>=3.16.0')
glib = dependency('glib-2.0', version: '>=2.44.0')
libgnomekbd = dependency('libgnomekbd', version: '>=3.0.0')
libgnomekbdui=dependency('libgnomekbdui', version: '>=3.0.0')
libnotify = dependency('libnotify', version: '>=0.7.3')
libx11 = dependency('x11')
polkit_gobj = dependency('polkit-gobject-1',version: '>=0.103')
libxklavier = dependency('libxklavier', version: '>=5.1')
config.set('HAVE_X11_EXTENSIONS_XKB_H', cc.has_header('X11/extensions/XKB.h'))
###############################################################################
# This is a hard-dependency for the region and user-accounts panels
isocodes = dependency('iso-codes')
config.set_quoted('ISO_CODES_PREFIX', isocodes.get_pkgconfig_variable('prefix'))
###############################################################################
# Network Manager stuff
if get_option('networkmanager')
libnm = dependency('libnm', version: '>=1.2.0')
libnma = dependency('libnma',version: '>=1.2.0')
else
libnm = dependency('', required: false)
libnma= dependency('', required: false)
endif
if get_option('modemmanager')
if not get_option('networkmanager')
error('*** NetworkManager is required by ModemManager ***')
endif
modemmanager = dependency('mm-glib', version: '>=0.7')
else
modemmanager = dependency('', required: false)
endif
config.set('BUILD_MODEM', modemmanager.found())
###############################################################################
# Color Management
if get_option('color')
colord = dependency('colord', version: '>=0.1.14')
else
colord = dependency('', required: false)
endif
###############################################################################
# Wacom Management
if get_option('wacom')
libwacom = dependency('libwacom', version: '>=0.7')
libxi = dependency('xi', version: '>=1.2')
cinn_settings_daemon = dependency('cinnamon-settings-daemon', version: '>=1.0.0')
else
libwacom = dependency('', required: false)
endif
config.set('HAVE_WACOM_3D_STYLUS', libwacom.version().version_compare('>=0.27'))
###############################################################################
# Online Accounts
if get_option('onlineaccounts')
goa = dependency('goa-1.0', version: '>=3.18.0')
goa_backend = dependency('goa-backend-1.0', version: '>=3.18.0')
else
goa = dependency('', required: false)
goa_backend = dependency('', required: false)
endif
###############################################################################
# Directories
# Relative paths
panels_dir = get_option('libdir') / 'cinnamon-control-center-1' / 'panels'
ui_dir = get_option('datadir') / meson.project_name() / 'ui'
um_pix_dir = get_option('datadir') / meson.project_name() / 'pixmaps'
menu_dir = get_option('sysconfdir') / 'xdg' / 'menus'
panel_def_dir = get_option('datadir') / meson.project_name() / 'panels'
prefix = get_option('prefix')
config.set_quoted('BINDIR', prefix / get_option('bindir'))
config.set_quoted('SBINDIR', prefix / get_option('sbindir'))
config.set_quoted('LIBLOCALEDIR', prefix / get_option('libdir') / 'locale')
config.set_quoted('LOCALE_DIR', prefix / get_option('localedir'))
config.set_quoted('CINNAMONLOCALEDIR', prefix / get_option('localedir'))
config.set_quoted('DATADIR', prefix / get_option('datadir'))
config.set_quoted('CINNAMONCC_DATA_DIR', prefix / get_option('datadir'))
config.set_quoted('CINNAMONCC_UI_DIR', prefix / ui_dir)
config.set_quoted('PANELS_DIR', prefix / panels_dir)
config.set_quoted('MENUDIR', '/' / menu_dir)
config.set_quoted('UIDIR', prefix / ui_dir)
config.set_quoted('UM_PIXMAP_DIR', prefix / um_pix_dir)
config.set_quoted('PANEL_DEF_DIR', prefix / panel_def_dir)
###############################################################################
# Build options
more_cflags = [
'-Wno-strict-aliasing',
'-Wno-sign-compare',
]
if get_option('warning_level').to_int() >=2
more_cflags += [
'-Wall',
'-Wclobbered',
'-Wempty-body',
'-Wignored-qualifiers',
'-Wmissing-field-initializers',
'-Wmissing-parameter-type',
'-Wold-style-declaration',
'-Woverride-init',
'-Wtype-limits',
'-Wuninitialized',
'-Wchar-subscripts',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wpointer-arith',
'-Wcast-align',
'-Wsign-compare',
]
endif
if get_option('buildtype').contains('rel')
more_cflags += '-Wp,-D_FORTIFY_SOURCE=2'
endif
if not get_option('deprecated_warnings')
add_global_arguments([
'-Wno-deprecated-declarations',
'-Wno-deprecated',
'-Wno-declaration-after-statement',
'-DGLIB_DISABLE_DEPRECATION_WARNINGS',
],
language: 'c',
)
endif
meson.add_install_script('meson_install_schemas.py')
add_project_arguments(cc.get_supported_arguments(more_cflags), language: 'c')
configure_file(
output: 'config.h',
configuration: config,
)
rootInclude = include_directories('.')
subdir('po')
subdir('shell')
subdir('panels')
final_message = [ '',
'',
'** NetworkManager (Network panel) : @0@'.format(libnm.found()),
'** ModemManager support : @0@'.format(modemmanager.found()),
'** Colord support (Color management panel) : @0@'.format(colord.found()),
'** Wacom support (Wacom panel) : @0@'.format(libwacom.found()),
'** Online-Accounts support (Online-Accounts panel) : @0@'.format(goa.found()),
'',
]
message('\n'.join(final_message))