[libdazzle] build: use linker script checks
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] build: use linker script checks
- Date: Sun, 3 Sep 2017 21:37:26 +0000 (UTC)
commit 4f34ef8e6140bc1d7686a29fdd2264b32a051698
Author: Christian Hergert <chergert redhat com>
Date: Sun Sep 3 14:37:17 2017 -0700
build: use linker script checks
meson.build | 6 ++++++
src/meson.build | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/meson.build b/meson.build
index 05bd403..d9a1078 100644
--- a/meson.build
+++ b/meson.build
@@ -84,6 +84,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(), 'libide/ide.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') # When used as subproject
libdir = join_paths(get_option('libdir'), package_subdir)
diff --git a/src/meson.build b/src/meson.build
index 42b0d62..6a4a785 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -86,7 +86,7 @@ endif
libdazzle_map = join_paths(meson.current_source_dir(), 'dazzle.map')
libdazzle_link_args = []
-if host_machine.system() == 'linux'
+if ld_supports_version_script
libdazzle_link_args += [ '-Wl,--version-script,' + libdazzle_map ]
endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]