diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 74 |
1 files changed, 54 insertions, 20 deletions
diff --git a/meson.build b/meson.build index d58cb36..34ad7b6 100644 --- a/meson.build +++ b/meson.build @@ -1,29 +1,63 @@ -project('mcproxy', 'c', default_options : ['c_std=gnu18']) +project('mcproxy', + 'c', + version: '0.1.0', + license: 'GPL2+', + default_options : ['c_std=gnu18'] +) -liburing = dependency('liburing') +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') +libcapng = dependency('libcap-ng') mcproxy_sources = [ - 'main.c', - 'uring.c', - 'signal-handler.c', - 'server.c', - 'server-proxy.c', - 'server-config.c', - 'announce.c', - 'config-parser.c', - 'rcon.c', - 'idle.c', - 'ptimer.c', - 'igmp.c', - 'systemd.c', - 'utils.c'] + 'main.c', + 'uring.c', + 'signal-handler.c', + 'server.c', + 'server-proxy.c', + 'server-config.c', + 'announce.c', + 'config-parser.c', + 'rcon.c', + 'idle.c', + 'ptimer.c', + 'igmp.c', + 'systemd.c', + 'utils.c' +] executable('mcproxy', mcproxy_sources, link_args: [ '-lanl' ], - dependencies : [liburing, - libsystemd, - libcapng]) + include_directories : configuration_inc, + dependencies: [ + liburing, + libsystemd, + libcapng, + config_h + ], +) |