[json-glib] build: Fix soversion for Meson builds



commit 1447d8b527864c10899dab3733068407b82fb19b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Mar 14 10:48:55 2017 +0000

    build: Fix soversion for Meson builds
    
    During stable cycles we want the interface age to match the micro
    version, as there are no symbol additions if the minor version is
    an even number.
    
    Conversely, we want the interface age to reset to 0, as there are
    no expectations of ABI compatibility for newly added symbols.
    
    The current check uses the micro version, instead of the odd version,
    which breaks the logic above.
    
    This ensures that the soname generated via the Meson build is the
    same as the one generated by the Autotools one.

 meson.build |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/meson.build b/meson.build
index 7890add..3192d4c 100644
--- a/meson.build
+++ b/meson.build
@@ -10,24 +10,24 @@ project('json-glib', 'c', version: '1.2.7',
 # Versionning
 json_version = meson.project_version()
 version_arr = json_version.split('.')
-json_version_major = version_arr[0]
-json_version_minor = version_arr[1]
-json_version_micro = version_arr[2]
+json_version_major = version_arr[0].to_int()
+json_version_minor = version_arr[1].to_int()
+json_version_micro = version_arr[2].to_int()
 
 apiversion = '1.0'
 soversion = 0
 
-if json_version_micro.to_int().is_odd()
+if json_version_minor.is_odd()
   json_interface_age = 0
 else
-  json_interface_age = json_version_micro.to_int()
+  json_interface_age = json_version_micro
 endif
 
 # maintaining compatibility with the previous libtool versioning
 # current = minor * 100 + micro - interface
 # revision = interface
 soversion = 0
-current = json_version_minor.to_int() * 100 + json_version_micro.to_int() - json_interface_age
+current = json_version_minor * 100 + json_version_micro - json_interface_age
 revision = json_interface_age
 libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
 


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