[libchamplain: 1/8] meson: Fix building api_version with odd minor



commit d6af20c63775070df7dc917001ae2be3dffc51ff
Author: Jan Alexander Steffens (heftig) <jan steffens gmail com>
Date:   Thu Feb 21 18:56:22 2019 +0100

    meson: Fix building api_version with odd minor
    
    `version_minor + 1` only works if version_minor is an int.

 meson.build | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/meson.build b/meson.build
index 3bdd0b5..47cddc7 100644
--- a/meson.build
+++ b/meson.build
@@ -14,15 +14,14 @@ pkg = import('pkgconfig')
 # Versioning
 version = meson.project_version()
 version_arr = version.split('.')
-version_major = version_arr[0]
-version_minor = version_arr[1]
-version_micro = version_arr[2]
-
-if version_minor.to_int().is_odd()
-  api_version = '.'.join([version_major, version_minor + 1])
-else
-  api_version = '.'.join([version_major, version_minor])
-endif
+version_major = version_arr[0].to_int()
+version_minor = version_arr[1].to_int()
+version_micro = version_arr[2].to_int()
+
+api_version = '@0@.@1@'.format(
+  version_major,
+  version_minor.is_odd() ? version_minor + 1 : version_minor,
+)
 
 # Before making a release, the LT_VERSION string should be modified.
 # The string is of the form C.A.R


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]