-
Notifications
You must be signed in to change notification settings - Fork 4
/
meson.build
68 lines (58 loc) · 2.04 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
project('genie-client', 'cpp', 'c',
version : '0.1.0',
meson_version : '>= 0.37.0',
default_options : [ 'warning_level=3', 'cpp_std=c++14' ]
)
app_command = 'genie-client'
app_id = meson.project_name()
if [ 'x86_64' ].contains(host_machine.cpu_family())
searchArch = 'x86_64-linux-gnu'
arch = 'x86_64'
elif [ 'arm' ].contains(host_machine.cpu_family())
searchArch = 'arm-linux-gnueabihf'
arch = 'armhf'
elif [ 'aarch64' ].contains(host_machine.cpu_family())
searchArch = 'aarch64-linux-gnu'
arch = 'arm64'
else
error('Unknown architecture @0@. Patches accepted to fix this.' . format(host_machine.cpu_family()))
endif
config_h = configuration_data()
config_h.set_quoted('PACKAGE_NAME', app_id)
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
config_h.set_quoted('PREFIX', get_option('prefix'))
config_h.set_quoted('OAUTH_CLIENT_ID', get_option('oauth_client_id'))
config_h.set_quoted('OAUTH_CLIENT_SECRET', get_option('oauth_client_secret'))
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), app_id)
pkglibdir = join_paths(get_option('prefix'), 'lib', app_id)
bindir = join_paths(get_option('prefix'), get_option('bindir'))
config_h.set_quoted('bindir', bindir)
config_h.set_quoted('libdir', join_paths(get_option('prefix'), get_option('libdir')))
config_h.set_quoted('pkglibdir', pkglibdir)
config_h.set_quoted('pkgdatadir', pkgdatadir)
config_h.set('STATIC', get_option('static'))
config_h.set('ARCH', arch)
configure_file(
output : 'config.h',
configuration : config_h,
)
add_global_arguments([
'-DHAVE_CONFIG_H',
'-I' + meson.build_root(),
'-Wno-unused',
], language : 'cpp')
add_global_arguments([
'-DHAVE_CONFIG_H',
'-I' + meson.build_root(),
'-Wno-unused',
], language : 'c')
subdir('src')
install_subdir('assets', install_dir: pkglibdir)
unitconf = configuration_data()
unitconf.set('bindir', bindir)
configure_file(
input : 'systemd/genie-client.service.in',
output : 'genie-client.service',
configuration : unitconf,
install_dir: join_paths(get_option('prefix'), 'lib', 'systemd', 'user')
)