[glib-networking/wip/nacho/openssl: 3/12] Fix for symbol visibility with msvc



commit e65d53051cb5989513db72d806faaf06a91e274e
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Mon Sep 10 17:23:12 2018 +0200

    Fix for symbol visibility with msvc

 meson.build             | 6 ++++++
 tls/gnutls/meson.build  | 3 ++-
 tls/openssl/meson.build | 3 ++-
 3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index a551a64..b6cf220 100644
--- a/meson.build
+++ b/meson.build
@@ -42,6 +42,12 @@ if host_system.contains('linux')
   module_ldflags += cc.get_supported_link_arguments(test_ldflag)
 endif
 
+extra_args= []
+# Detect and set symbol visibility
+if cc.get_id() == 'msvc'
+  extra_args += ['-D_GLIB_EXTERN=__declspec (dllexport) extern']
+endif
+
 # *** Check GLib GIO        ***
 glib_dep = dependency('glib-2.0', version: '>= 2.55.1',
   fallback: ['glib', 'libglib_dep'])
diff --git a/tls/gnutls/meson.build b/tls/gnutls/meson.build
index 55280c9..dcfd8c9 100644
--- a/tls/gnutls/meson.build
+++ b/tls/gnutls/meson.build
@@ -42,7 +42,8 @@ module = shared_module(
   link_depends: symbol_map,
   name_suffix: module_suffix,
   install: true,
-  install_dir: gio_module_dir
+  install_dir: gio_module_dir,
+  c_args: extra_args
 )
 
 if get_option('static_modules')
diff --git a/tls/openssl/meson.build b/tls/openssl/meson.build
index 5bec3b1..6684007 100644
--- a/tls/openssl/meson.build
+++ b/tls/openssl/meson.build
@@ -31,7 +31,8 @@ module = shared_module(
   link_depends: symbol_map,
   name_suffix: module_suffix,
   install: true,
-  install_dir: gio_module_dir
+  install_dir: gio_module_dir,
+  c_args: extra_args
 )
 
 if get_option('static_modules')


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