Commit 7b258a2f authored by Uli Schlachter's avatar Uli Schlachter
Browse files

Merge branch 'libversion-fixup-match-autotools' into 'master'

meson: fix library versioning

Closes #442

See merge request cairo/cairo!84
parents e22d7212 e9ccb1d8
...@@ -3,8 +3,6 @@ project('cairo', 'c', 'cpp', ...@@ -3,8 +3,6 @@ project('cairo', 'c', 'cpp',
version: run_command(find_program('version.py'), check: true).stdout().strip(), version: run_command(find_program('version.py'), check: true).stdout().strip(),
) )
cc = meson.get_compiler('c')
# Keep in sync with configure.ac! # Keep in sync with configure.ac!
freetype_required_version = '>= 9.7.3' freetype_required_version = '>= 9.7.3'
fontconfig_required_version = '>= 2.2.95' fontconfig_required_version = '>= 2.2.95'
...@@ -16,6 +14,27 @@ libudev_required_version = '>= 136' ...@@ -16,6 +14,27 @@ libudev_required_version = '>= 136'
libdrm_required_version = '>= 2.4' libdrm_required_version = '>= 2.4'
glib_required_version = '>= 2.14' glib_required_version = '>= 2.14'
# library versioning
version_arr = meson.project_version().split('.')
cairo_version_major = version_arr[0].to_int()
cairo_version_minor = version_arr[1].to_int()
cairo_version_micro = version_arr[2].to_int()
# The libtool shared library version stuff.
# Try and maintain compatibility with the previous library versioning.
cairo_version_sonum = cairo_version_major + 1
cairo_version = cairo_version_major * 10000 + cairo_version_minor * 100 + cairo_version_micro
if cairo_version_minor % 2 == 1
# unstable release
cairo_libversion = '@0@.@1@.0'.format(cairo_version_sonum, cairo_version)
else
# stable release
cairo_libversion = '@0@.@1@.@2@'.format(cairo_version_sonum, cairo_version, cairo_version_micro)
endif
cc = meson.get_compiler('c')
if cc.get_id() == 'msvc' if cc.get_id() == 'msvc'
# Basic usage in the cairo type system that causes spammy and useless warnings # Basic usage in the cairo type system that causes spammy and useless warnings
add_project_arguments('/wd4244', '/wd4146', add_project_arguments('/wd4244', '/wd4146',
......
...@@ -299,8 +299,8 @@ libcairo = library('cairo', cairo_sources, ...@@ -299,8 +299,8 @@ libcairo = library('cairo', cairo_sources,
c_args: cairo_no_warn_c_args + pthread_c_args + ['-DHAVE_CONFIG_H'], c_args: cairo_no_warn_c_args + pthread_c_args + ['-DHAVE_CONFIG_H'],
cpp_args: cairo_no_warn_c_args + pthread_c_args + ['-DHAVE_CONFIG_H'], cpp_args: cairo_no_warn_c_args + pthread_c_args + ['-DHAVE_CONFIG_H'],
link_args: extra_link_args, link_args: extra_link_args,
soversion: '2', soversion: cairo_version_sonum,
version: '2.' + ''.join(meson.project_version().split('.')) + '.0', version: cairo_libversion,
install: true, install: true,
include_directories: incbase, include_directories: incbase,
) )
......
...@@ -12,8 +12,8 @@ libcairogobject = library('cairo-gobject', cairo_gobject_sources, ...@@ -12,8 +12,8 @@ libcairogobject = library('cairo-gobject', cairo_gobject_sources,
include_directories: [incbase, incsrc], include_directories: [incbase, incsrc],
dependencies: [glib_dep, gobject_dep], dependencies: [glib_dep, gobject_dep],
link_with: [libcairo], link_with: [libcairo],
soversion: '2', soversion: cairo_version_sonum,
version: '2.' + ''.join(meson.project_version().split('.')) + '.0', version: cairo_libversion,
install: true, install: true,
) )
......
...@@ -30,8 +30,8 @@ libcairoscript = library('cairo-script-interpreter', ...@@ -30,8 +30,8 @@ libcairoscript = library('cairo-script-interpreter',
include_directories: [incbase, incsrc], include_directories: [incbase, incsrc],
dependencies: deps, dependencies: deps,
link_with: [libcairo], link_with: [libcairo],
soversion: '2', soversion: cairo_version_sonum,
version: '2.' + ''.join(meson.project_version().split('.')) + '.0', version: cairo_libversion,
install: true, install: true,
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment