summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-01-03 11:13:40 -0500
committerXavier Claessens <xavier.claessens@collabora.com>2018-05-17 10:27:01 -0400
commit487b1fd20c5e494366a82ddc0fa6b53b8bd779ad (patch)
treea200bd3d7b47947fad13ec2647ff7dfd189a89d2
parent53d3455e759645abb0d2462808ca389be7964baf (diff)
downloadglib-487b1fd20c5e494366a82ddc0fa6b53b8bd779ad.tar.gz
Meson: Add export-dynamic flag
https://bugzilla.gnome.org/show_bug.cgi?id=788773
-rw-r--r--gmodule/meson.build4
-rw-r--r--meson.build16
2 files changed, 17 insertions, 3 deletions
diff --git a/gmodule/meson.build b/gmodule/meson.build
index ddec32ab0..8bb61897b 100644
--- a/gmodule/meson.build
+++ b/gmodule/meson.build
@@ -118,7 +118,7 @@ pkg.generate(libraries : [libgmodule, thread_dep],
description : 'Dynamic module loader for GLib',
)
-pkg.generate(libraries : [libgmodule],
+pkg.generate(libraries : [libgmodule, export_dynamic_ldflags],
requires : ['glib-2.0'],
version : glib_version,
variables : [supported_var],
@@ -128,7 +128,7 @@ pkg.generate(libraries : [libgmodule],
description : 'Dynamic module loader for GLib',
)
-pkg.generate(libraries : [libgmodule],
+pkg.generate(libraries : [libgmodule, export_dynamic_ldflags],
requires : ['glib-2.0'],
version : glib_version,
variables : [supported_var],
diff --git a/meson.build b/meson.build
index 31dc99f15..568ec6083 100644
--- a/meson.build
+++ b/meson.build
@@ -1770,7 +1770,21 @@ if libmount_dep.length() != 0
glib_conf.set('HAVE_LIBMOUNT', 1)
endif
glib_conf.set('GIO_MODULE_DIR', glib_giomodulesdir)
-# FIXME: Missing: @G_MODULE_LDFLAGS@
+
+# Sadly Meson does not expose this value:
+# https://github.com/mesonbuild/meson/pull/3460
+if host_system == 'windows'
+ # Autotools explicitly removed --Wl,--export-all-symbols from windows builds,
+ # with no explanation. Do the same here for now but this could be revisited if
+ # if causes issues.
+ export_dynamic_ldflags = []
+elif host_system == 'cygwin'
+ export_dynamic_ldflags = ['-Wl,--export-all-symbols']
+elif host_system == 'darwin'
+ export_dynamic_ldflags = []
+else
+ export_dynamic_ldflags = ['-Wl,--export-dynamic']
+endif
win32_cflags = []
win32_ldflags = []