From bead8287a5c047f31e6efe5c49039278341ae46c Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 28 Aug 2018 15:17:00 +0530 Subject: Improve support for macOS dylib versioning We now use the soversion to set compatibility_version and current_version by default. This is the only sane thing we can do by default because of the restrictions on the values that can be used for compatibility and current version. Users can override this value with the `darwin_versions:` kwarg, which can be a single value or a two-element list of values. The first one is the compatibility version and the second is the current version. Fixes https://github.com/mesonbuild/meson/issues/3555 Fixes https://github.com/mesonbuild/meson/issues/1451 --- test cases/osx/2 library versions/installed_files.txt | 2 +- test cases/osx/2 library versions/meson.build | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'test cases/osx') diff --git a/test cases/osx/2 library versions/installed_files.txt b/test cases/osx/2 library versions/installed_files.txt index de7b078..f9c629b 100644 --- a/test cases/osx/2 library versions/installed_files.txt +++ b/test cases/osx/2 library versions/installed_files.txt @@ -1,5 +1,5 @@ usr/lib/libsome.dylib -usr/lib/libsome.0.dylib +usr/lib/libsome.7.dylib usr/lib/libnoversion.dylib usr/lib/libonlyversion.dylib usr/lib/libonlyversion.1.dylib diff --git a/test cases/osx/2 library versions/meson.build b/test cases/osx/2 library versions/meson.build index acd58a5..26f945a 100644 --- a/test cases/osx/2 library versions/meson.build +++ b/test cases/osx/2 library versions/meson.build @@ -8,7 +8,7 @@ some = shared_library('some', 'lib.c', build_rpath : zlib_dep.get_pkgconfig_variable('libdir'), dependencies : zlib_dep, version : '1.2.3', - soversion : '0', + soversion : '7', install : true) noversion = shared_library('noversion', 'lib.c', @@ -23,6 +23,21 @@ onlysoversion = shared_library('onlysoversion', 'lib.c', soversion : 5, install : true) +shared_library('intver', 'lib.c', + darwin_versions : 2) + +shared_library('stringver', 'lib.c', + darwin_versions : '2.3') + +shared_library('stringlistver', 'lib.c', + darwin_versions : ['2.4']) + +shared_library('intstringver', 'lib.c', + darwin_versions : [1111, '2.5']) + +shared_library('stringlistvers', 'lib.c', + darwin_versions : ['2.6', '2.6.1']) + # Hack to make the executables below depend on the shared libraries above # without actually adding them as `link_with` dependencies since we want to try # linking to them with -lfoo linker arguments. -- cgit v1.1