[gtk/ebassi/for-master: 7/7] build: Use Meson support for dylib versions




commit 474b4ac1afb89877bd6957a33128d7cc561d2769
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Dec 15 12:47:05 2020 +0000

    build: Use Meson support for dylib versions
    
    Do not hand-code it inside GTK's meson.build.

 gtk/meson.build | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gtk/meson.build b/gtk/meson.build
index 5f6877d468..9f07d3d5f0 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -1093,11 +1093,13 @@ if cc.has_header('langinfo.h')
   endforeach
 endif
 
-# Maintain compatibility with autotools
-gtk_ldflags = []
-if os_darwin
-  gtk_ldflags += [ '-compatibility_version 1', '-current_version 1.0', ]
-endif
+# Generate versions for macOS dylib
+darwin_versions = [
+  # compatibility version
+  1 + '@0@'.format(gtk_binary_age - gtk_interface_age).to_int(),
+  # current version
+  '@0@.@1@'.format(1 + '@0@'.format(gtk_binary_age - gtk_interface_age).to_int(), gtk_interface_age),
+]
 
 # Library
 libgtk = library('gtk-4',
@@ -1108,7 +1110,8 @@ libgtk = library('gtk-4',
   include_directories: [confinc, gdkinc, gskinc, gtkinc],
   dependencies: gtk_deps + [libgtk_css_dep, libgdk_dep, libgsk_dep],
   link_whole: [libgtk_css, libgdk, libgsk, ],
-  link_args: common_ldflags + gtk_ldflags,
+  link_args: common_ldflags,
+  darwin_versions: darwin_versions,
   install: true,
 )
 


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