-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
68 lines (56 loc) · 1.53 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(
'xsocket', 'c',
default_options: {
'b_ndebug': 'if-release',
'buildtype': 'release',
'warning_level': '1',
'strip': true
},
version: '1.2')
add_project_arguments('-D_GNU_SOURCE', language: 'c')
if get_option('debug')
add_project_arguments('-D_DEBUG', language: 'c')
endif
install_headers('xsocket.h')
systemd = dependency('systemd', required: false)
libsystemd = dependency('libsystemd', required: false)
python = import('python').find_installation('python3', required: false)
if systemd.found()
install_data('xsocket.service',
install_dir: systemd.get_variable(pkgconfig: 'systemd_system_unit_dir'))
install_data('xsocket.sysusers',
install_dir: systemd.get_variable(pkgconfig: 'sysusers_dir'),
rename: 'xsocket.conf')
endif
if libsystemd.found()
add_project_arguments('-DXSOCKET_SYSTEMD', '-DSD_JOURNAL_SUPPRESS_LOCATION', language: 'c')
endif
xsocket_common = static_library(
'xsocket_common',
'cleanup.c',
'socket.c',
'protocol.c',
gnu_symbol_visibility: 'hidden')
xsocket_library = shared_library(
'xsocket',
'xsocket.c',
gnu_symbol_visibility: 'hidden',
link_with: xsocket_common,
install: true)
shared_library(
'xbind',
'hook.c',
'switch.c',
gnu_symbol_visibility: 'hidden',
link_with: [xsocket_common, xsocket_library],
install: true)
executable(
'xsocket-server',
'server.c',
dependencies: libsystemd,
gnu_symbol_visibility: 'hidden',
link_with: xsocket_common,
install: true)
if python.found() and python.language_version().version_compare('>=3.12')
python.install_sources('xsocket.py')
endif