summaryrefslogtreecommitdiff
path: root/meson.build
blob: 3d82301ed2620f2fc10dfdcd5c504dd0f4576973 (plain)
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
project('mcproxy',
	'c',
	version: '0.1.0',
	license: 'GPL2+',
	default_options : ['c_std=gnu18']
)

sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'), meson.project_name())
mainconfname = meson.project_name() + '.conf'

conf = configuration_data()
conf.set_quoted('VERSION', '@0@-@VCS_TAG@'.format(meson.project_version()))
conf.set_quoted('DEFAULT_CFG_DIR', sysconfdir)
conf.set_quoted('DEFAULT_MAIN_CFG_FILE', mainconfname)

config_h = declare_dependency(
	sources: vcs_tag(
		command: ['git', 'rev-parse', '--short', 'HEAD'],
		fallback: get_option('profile') != 'default' ? 'devel' : 'stable',
		input: configure_file (
			output: 'config.h.in',
			input: 'config.h.in',
			configuration: conf
		),
		output: 'config.h'
	)
)

configuration_inc = include_directories('.')

liburing   = dependency('liburing')
libsystemd = dependency('libsystemd')
libcapng   = dependency('libcap-ng')

mcproxy_sources = [
	'main.c',
	'uring.c',
	'signal-handler.c',
	'server.c',
	'server-proxy.c',
	'server-config.c',
	'server-rcon.c',
	'rcon-protocol.c',
	'announce.c',
	'config-parser.c',
	'idle.c',
	'ptimer.c',
	'igmp.c',
	'systemd.c',
	'utils.c'
]

executable('mcproxy',
	   mcproxy_sources,
	   link_args: [ '-lanl' ],
	   include_directories : configuration_inc,
	   dependencies: [
		liburing,
		libsystemd,
		libcapng,
		config_h
	   ],
)