[jsonrpc-glib] build: check for version-script support from linker
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jsonrpc-glib] build: check for version-script support from linker
- Date: Sun, 3 Sep 2017 21:52:24 +0000 (UTC)
commit 72581978ff89d2e437308aacbb4fad966937e441
Author: Christian Hergert <chergert redhat com>
Date: Sun Sep 3 14:51:58 2017 -0700
build: check for version-script support from linker
meson.build | 6 ++++++
src/meson.build | 6 +++++-
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/meson.build b/meson.build
index c90bea3..df49fb0 100644
--- a/meson.build
+++ b/meson.build
@@ -82,6 +82,12 @@ add_project_arguments(
language: 'c'
)
+# Check if we can use version scripts for ABI exports
+ld_supports_version_script = cc.links('''
+ int main (void) { return 0; }
+''', args: '-Wl,--version-script,' + join_paths(meson.source_root(), 'src/jsonrpc-glib.map'))
+message('Linker supports --version-script: @0@'.format(ld_supports_version_script))
+
# Setup various paths that subdirectory meson.build files need
package_subdir = get_option('package_subdir')
girdir = join_paths(get_option('datadir'), package_subdir, 'gir-1.0')
diff --git a/src/meson.build b/src/meson.build
index 49b1448..c8b9c2d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,13 +47,17 @@ libjsonrpc_glib_sources = [
libjsonrpc_glib_public_sources,
]
+libjsonrpc_glib_link_args = []
+if ld_supports_version_script
+libjsonrpc_glib_link_args += ['-Wl,--version-script,' + join_paths(meson.current_source_dir(),
'jsonrpc-glib.map')]
+endif
libjsonrpc_glib = library(
'jsonrpc_glib-' + apiversion,
libjsonrpc_glib_sources,
link_depends: 'jsonrpc-glib.map',
- link_args: [ '-Wl,--version-script,' + join_paths(meson.current_source_dir(), 'jsonrpc-glib.map') ],
+ link_args: libjsonrpc_glib_link_args,
dependencies: libjsonrpc_glib_deps,
soversion: soversion,
version: libversion,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]