From fd5db1994b4fec8919d946674ed241e053d21738 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 28 Dec 2016 11:39:58 +0000 Subject: [PATCH] build: Set the appropriate versioning for the shared library We use the same versioning scheme that GLib and GTK+ use, with the API version as part of the file name, and the minor and micro version as part of the soname. This allows parallel installation based on the API major version, with ABI-compatible updates within the same API version. --- meson.build | 5 +++++ src/meson.build | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 223c854..0fd242a 100644 --- a/meson.build +++ b/meson.build @@ -29,6 +29,11 @@ endif emeus_binary_age = emeus_minor_version * 100 + emeus_micro_version +# Shared library versioning +current = emeus_binary_age - emeus_interface_age +revision = emeus_interface_age +libversion = '0.@0@.@1@'.format(current, revision) + # Paths for the pkg-config file emeus_prefix = get_option('prefix') emeus_bindir = join_paths(emeus_prefix, get_option('bindir')) diff --git a/src/meson.build b/src/meson.build index 2e98178..dc11078 100644 --- a/src/meson.build +++ b/src/meson.build @@ -63,7 +63,8 @@ libemeus_private = static_library('emeus-private', libemeus = shared_library('emeus-@0@'.format(emeus_api_version), sources: sources + solver_sources + private_headers, - version: meson.project_version(), + soversion: 0, + version: libversion, install: true, dependencies: [ gtk_dep, mathlib_dep ], c_args: common_cflags + debug_cflags + gtk_version_cflags + [