meson: cleanup version detection

Tell Meson what version the project is, so that we set the right versioning
on libnethogs.
This commit is contained in:
Sam James
2025-01-25 16:03:12 +00:00
parent 632a78846e
commit 049fff5623

View File

@@ -5,11 +5,11 @@
project('nethogs', project('nethogs',
['c', 'cpp'], ['c', 'cpp'],
default_options : ['warning_level=3', default_options : ['warning_level=3',
'cpp_std=c++14'] 'cpp_std=c++14'],
version : run_command('./determineVersion.sh').stdout().strip(),
) )
cc = meson.get_compiler('cpp') cc = meson.get_compiler('cpp')
version = run_command('./determineVersion.sh', check: true).stdout().strip()
####################################### #######################################
## Dependencies and flags definition ## ## Dependencies and flags definition ##
@@ -19,7 +19,7 @@ projectinc = [include_directories('.', 'src')]
# flags # flags
c_args = [ c_args = [
'-DVERSION="' + version + '"' '-DVERSION="' + meson.project_version() + '"'
] ]
# dependencies # dependencies
@@ -42,5 +42,5 @@ pkgconfig = import('pkgconfig')
pkgconfig_install_dir = join_paths(get_option('libdir'), 'pkgconfig') pkgconfig_install_dir = join_paths(get_option('libdir'), 'pkgconfig')
pkgconfig.generate(libnethogs, pkgconfig.generate(libnethogs,
requires: ['libpcap'], requires: ['libpcap'],
version: version version: meson.project_version()
) )