-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
128 lines (114 loc) · 3.82 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
project('xdg-desktop-portal-phosh', 'c',
version: '0.42.rc1',
license: 'GPL-3.0-or-later',
meson_version: '>= 1.0.0',
default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ],
)
pmp_exe_name = 'xdg-desktop-portal-phosh'
pmp_dbus_name = 'org.freedesktop.impl.portal.desktop.phosh'
pmp_portals = [
'org.freedesktop.impl.portal.Settings',
'org.freedesktop.impl.portal.Wallpaper',
]
prefix = get_option('prefix')
datadir = prefix / get_option('datadir')
libexecdir = prefix / get_option('libexecdir')
localedir = prefix / get_option('localedir')
desktopdir = datadir / 'applications'
servicedir = datadir / 'dbus-1' / 'services'
portaldir = datadir / 'xdg-desktop-portal' / 'portals'
glib_ver = '2.74'
glib_ver_str = 'GLIB_VERSION_@0@'.format(glib_ver.replace('.','_'))
glib_ver_cmp = '>=@0@'.format(glib_ver)
gtk_ver = '4.12'
gtk_ver_str = 'GDK_VERSION_@0@'.format(gtk_ver.replace('.','_'))
gtk_ver_cmp = '>=@0@'.format(gtk_ver)
adw_ver = '1.6'
adw_ver_str = 'ADW_VERSION_@0@'.format(adw_ver.replace('.','_'))
adw_ver_cmp = '>=@0@'.format(adw_ver)
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,
'-DGLIB_VERSION_MIN_REQUIRED=@0@'.format(glib_ver_str),
'-DGLIB_VERSION_MAX_ALLOWED=@0@'.format(glib_ver_str),
'-DGDK_VERSION_MIN_REQUIRED=@0@'.format(gtk_ver_str),
'-DGDK_VERSION_MAX_ALLOWED=@0@'.format(gtk_ver_str),
'-DADW_VERSION_MIN_REQUIRED=@0@'.format(adw_ver_str),
'-DADW_VERSION_MAX_ALLOWED=@0@'.format(adw_ver_str),
],
language: 'c',
)
gnome = import('gnome')
i18n = import('i18n')
pkgconfig = import ('pkgconfig')
adwaita_dep = dependency('libadwaita-1', version: adw_ver_cmp)
fontconfig_dep = dependency('fontconfig')
gio_dep = dependency('gio-2.0', version: glib_ver_cmp)
gio_unix_dep = dependency('gio-unix-2.0', version: glib_ver_cmp)
glib_dep = dependency('glib-2.0', version: glib_ver_cmp)
gnome_bg_dep = dependency('gnome-bg-4', version: '>=43')
gnome_desktop_dep = dependency('gnome-desktop-4', version: '>=43')
gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas', version: '>= 47')
gtk_dep = dependency('gtk4', version: gtk_ver_cmp)
gtk_wayland_dep = dependency('gtk4-wayland', version: gtk_ver_cmp)
xdg_desktop_portal_dep = dependency('xdg-desktop-portal', version: '>= 1.14.0')
config_h = configuration_data()
config_h.set_quoted('GETTEXT_PACKAGE', 'phosh-mobile-portal')
config_h.set_quoted('LOCALEDIR', localedir)
config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version()))
config_h.set_quoted('PMP_DBUS_NAME', pmp_dbus_name)
configure_file(
output: 'pmp-config.h',
configuration: config_h,
)
subdir('data')
subdir('po')
subdir('src')