-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
meson.build
69 lines (59 loc) · 2.14 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
project('xdg-desktop-portal-hyprland', 'cpp', 'c',
version: run_command('cat', files('VERSION'), check: true).stdout().strip(),
license: 'BSD-3-Clause',
meson_version: '>=0.63.0',
default_options: [
'warning_level=2',
'optimization=3',
'buildtype=release',
'debug=false',
# 'cpp_std=c++23' # not yet supported by meson, as of version 0.63.0
],
)
# clang v14.0.6 uses C++2b instead of C++23, so we've gotta account for that
# replace the following with a project default option once meson gets support for C++23
cpp_compiler = meson.get_compiler('cpp')
if cpp_compiler.has_argument('-std=c++23')
add_global_arguments('-std=c++23', language: 'cpp')
elif cpp_compiler.has_argument('-std=c++2b')
add_global_arguments('-std=c++2b', language: 'cpp')
else
error('Could not configure current C++ compiler (' + cpp_compiler.get_id() + ' ' + cpp_compiler.version() + ') with required C++ standard (C++23)')
endif
add_project_arguments(cpp_compiler.get_supported_arguments([
'-Wno-missing-field-initializers',
'-Wno-narrowing',
'-Wno-pointer-arith',
'-Wno-unused-parameter',
'-Wno-unused-value',
'-fpermissive',
'-Wno-address-of-temporary'
]), language: 'cpp')
conf_data = configuration_data()
conf_data.set('LIBEXECDIR', join_paths(get_option('prefix'), get_option('libexecdir')))
systemd = dependency('systemd', required: get_option('systemd'))
if systemd.found()
systemd_service_file = 'xdg-desktop-portal-hyprland.service'
user_unit_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir',
pkgconfig_define: ['prefix', get_option('prefix')])
configure_file(
configuration: conf_data,
input: 'contrib/systemd/' + systemd_service_file + '.in',
output: '@BASENAME@',
install_dir: user_unit_dir,
)
endif
configure_file(
configuration: conf_data,
input: 'org.freedesktop.impl.portal.desktop.hyprland.service.in',
output: '@BASENAME@',
install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services'),
)
install_data(
'hyprland.portal',
install_dir: join_paths(get_option('datadir'), 'xdg-desktop-portal', 'portals'),
)
inc = include_directories('.', 'protocols')
subdir('protocols')
subdir('src')
subdir('hyprland-share-picker')