[json-glib/wip/ordered-iter: 1/2] build: Maintain Autotools compatibility on Darwin




commit f24bc0f561c4e966006b0ad5cb51f230a69617c1
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Aug 24 16:03:44 2020 +0100

    build: Maintain Autotools compatibility on Darwin
    
    JSON-GLib 1.2 was the last release using Autotools on Darwin, which
    means we cannot use "1" as the compatibility version argument.
    
    We should also use the `darwin_versions` argument for `library()` to let
    Meson do the right thing depending on the platform, instead of passing
    linker flags ourselves.
    
    Original patch by: Tom Schoonjans
    
    Fixes: #41

 json-glib/meson.build |  1 +
 meson.build           | 11 +++--------
 2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/json-glib/meson.build b/json-glib/meson.build
index 6cef755..70c3171 100644
--- a/json-glib/meson.build
+++ b/json-glib/meson.build
@@ -78,6 +78,7 @@ json_lib = library(
   dependencies: [gio_dep],
   c_args: json_c_args + common_cflags,
   link_args: common_ldflags,
+  darwin_versions: darwin_versions,
   install: true,
 )
 
diff --git a/meson.build b/meson.build
index 31ac1b3..2aeafe0 100644
--- a/meson.build
+++ b/meson.build
@@ -23,7 +23,10 @@ json_gettext_domain = json_api_name
 
 # Maintain compatibility with the old soname versioning
 soversion = 0
+current = json_binary_age - json_interface_age
+revision = json_interface_age
 libversion = '@0@.@1@.@2@'.format(soversion, json_binary_age - json_interface_age, json_interface_age)
+darwin_versions = [ current + 1, '@0@.@1@'.format(current + 1, revision) ]
 
 # Paths
 json_includedir = join_paths(get_option('prefix'), get_option('includedir'))
@@ -144,14 +147,6 @@ if host_system == 'linux'
   ])
 endif
 
-# Maintain compatibility with autotools
-if host_system == 'darwin'
-  common_ldflags += [
-    '-compatibility_version 1',
-    '-current_version @0@.@1@'.format(json_binary_age - json_interface_age, json_interface_age),
-  ]
-endif
-
 root_dir = include_directories('.')
 
 gnome = import('gnome')


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