Skip to content

Commit

Permalink
meson: Add macOS libtool versioning for ABI compatibility
Browse files Browse the repository at this point in the history
With this, the compatibility version and current version values in macOS
and iOS dylibs will match the values set by Autotools.

See: mesonbuild/meson#1451
  • Loading branch information
nirbheek committed Aug 29, 2018
1 parent 042b2af commit 075352d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions gio/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ libgio = library('gio-2.0',
gio_dtrace_hdr, gio_dtrace_obj,
version : library_version,
soversion : soversion,
darwin_versions : darwin_versions,
install : true,
include_directories : [configinc, gioinc],
link_with : internal_deps,
Expand Down
1 change: 1 addition & 0 deletions glib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ libglib = library('glib-2.0',
sources : [deprecated_sources, glib_sources],
version : library_version,
soversion : soversion,
darwin_versions : darwin_versions,
install : true,
# intl.lib is not compatible with SAFESEH
link_args : [noseh_link_args, glib_link_flags, win32_ldflags],
Expand Down
1 change: 1 addition & 0 deletions gmodule/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ libgmodule = library('gmodule-2.0',
sources : gmodule_sources,
version : library_version,
soversion : soversion,
darwin_versions : darwin_versions,
install : true,
include_directories : [configinc, gmoduleinc],
dependencies : [libdl_dep, libglib_dep],
Expand Down
1 change: 1 addition & 0 deletions gobject/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ libgobject = library('gobject-2.0',
sources : gobject_sources,
version : library_version,
soversion : soversion,
darwin_versions : darwin_versions,
install : true,
include_directories : [configinc],
dependencies : [libffi_dep, libglib_dep],
Expand Down
1 change: 1 addition & 0 deletions gthread/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ libgthread = library('gthread-2.0',
sources : gthread_sources,
version : library_version,
soversion : soversion,
darwin_versions : darwin_versions,
install : true,
dependencies : [libglib_dep],
c_args : ['-DG_LOG_DOMAIN="GThread"' ] + glib_hidden_visibility_args,
Expand Down
6 changes: 4 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('glib', 'c', 'cpp',
version : '2.57.3',
meson_version : '>= 0.47.0',
meson_version : '>= 0.48',
default_options : [
'buildtype=debugoptimized',
'warning_level=1',
Expand Down Expand Up @@ -45,7 +45,9 @@ binary_age = 100 * minor_version + micro_version
soversion = 0
# Maintain compatibility with previous libtool versioning
# current = minor * 100 + micro
library_version = '@0@.@1@.@2@'.format(soversion, binary_age - interface_age, interface_age)
current = binary_age - interface_age
library_version = '@0@.@1@.@2@'.format(soversion, current, interface_age)
darwin_versions = [current + 1, '@0@.@1@'.format(current + 1, interface_age)]

configinc = include_directories('.')
glibinc = include_directories('glib')
Expand Down

0 comments on commit 075352d

Please sign in to comment.