summaryrefslogtreecommitdiff
path: root/meson.build
blob: eb9ae1eab80d69a73f057a21eac6b2725823f30a (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
project('minecproxy',
	'c',
	version: '0.1.0',
	license: 'GPL2+',
	default_options : [
		'c_std=gnu18',
		'sysconfdir=/etc',
		'warning_level=2',
	]
)

cc = meson.get_compiler('c')

basic_disabled_warnings = [
	'-Wno-sign-compare',
]
add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')

add_project_arguments('-D_GNU_SOURCE', language: 'c')

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)

inc_config_h = include_directories('.')
dep_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'
	),
	include_directories : inc_config_h,
)

subdir('shared')
subdir('minecproxy')
subdir('minecctl')