aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-07-18 13:44:14 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2018-07-18 13:44:14 +0200
commit2b118a33f65866295eeb716c9bc6401082ca4c8e (patch)
tree042696805aa8fff5920a7ad3753689e5b7323353 /meson.build
parentc7e53c7f8fd437819d572aaeb0ad12ac1fdc3187 (diff)
parent7f7e34a2ac9bae5ce06c979cf535aed06fca276d (diff)
downloadlibnitrokey-2b118a33f65866295eeb716c9bc6401082ca4c8e.tar.gz
libnitrokey-2b118a33f65866295eeb716c9bc6401082ca4c8e.tar.bz2
Merge branch 'pr_127'
Meson: - fix typo in lib name - use real library version in getter Fixes #127
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build22
1 files changed, 20 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 79f9d77..21e79f5 100644
--- a/meson.build
+++ b/meson.build
@@ -28,13 +28,31 @@ endif
if get_option('log-volatile-data')
libnitrokey_args += ['-DLOG_VOLATILE_DATA']
endif
+
+version_array = meson.project_version().split('.')
+version_major = version_array[0].to_int()
+version_minor = version_array[1].to_int()
+version_data = configuration_data()
+version_data.set('PROJECT_VERSION_MAJOR', version_major)
+version_data.set('PROJECT_VERSION_MINOR', version_minor)
+# We don't want to substitute it by noop
+version_data.set('PROJECT_VERSION_GIT', '@VCS_TAG@')
+version_cc_in = configure_file(
+ input : 'version.cc.in',
+ output : 'version.cc.in',
+ configuration : version_data,
+)
+version_cc = vcs_tag(
+ input : version_cc_in,
+ output : 'version.cc',
+)
libnitrokey = library(
- 'nitokey',
+ 'nitrokey',
sources : [
'command_id.cc',
'device.cc',
'log.cc',
- 'version.cc',
+ version_cc,
'misc.cc',
'NitrokeyManager.cc',
'NK_C_API.cc',