[gtk/gtk-3-24-meson: 41/99] gdk/meson.build: Force-export gdk_win32_display_manager_get_type()



commit 654c769051e532f588f33d7dbc433692c490c2b5
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Mar 13 12:52:25 2019 +0800

    gdk/meson.build: Force-export gdk_win32_display_manager_get_type()
    
    ...on Visual Studio builds, as it seems that the linker is optimizing
    that symbol out (hence it is not exported in the DLL).  This is to
    ensure that the introspection files for GdkWin32 build.

 gdk/meson.build | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/gdk/meson.build b/gdk/meson.build
index dfe91ef16e..8d296a6343 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -258,6 +258,14 @@ if gdk_backends.length() == 0
   error('No backends enabled')
 endif
 
+gdk_link_args = common_ldflags
+
+# Somehow gdk_win32_display_manager_get_type is not being exported as it
+# seems that it was optimized out by the MSVC linker.  Force-export it here.
+if cc.get_id() == 'msvc'
+  gdk_link_args += [ '-export:gdk_win32_display_manager_get_type' ]
+endif
+
 libgdk = shared_library('gdk-3',
                         sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
                         dependencies: gdk_deps,
@@ -267,7 +275,7 @@ libgdk = shared_library('gdk-3',
                           '-DG_LOG_DOMAIN="Gdk"',
                         ] + common_cflags,
                         link_whole: gdk_backends,
-                        link_args: common_ldflags,
+                        link_args: gdk_link_args,
                         darwin_versions : gtk_osxversions,
                         install: true)
 


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