build: Don't export GResource-related symbols with newer GLib

This makes the desired behaviour explicit, and matches the behaviour
seen with Meson, where "external : false" is the default.

Before GNOME/glib!1468, not passing --internal to the resource compiler
meant "no special export attribute, do what you would normally do",
so these symbols were not exported due to our global use of
-fvisibility=hidden.

However, since GNOME/glib!1468, not passing --internal to the resource
compiler results in the symbols being decorated with G_MODULE_EXPORT,
which overrides -fvisibility=hidden. This was necessary because Windows
DLLs normally behave a bit like the equivalent of ELF libraries with
-fvisibility=hidden.

Signed-off-by: Simon McVittie <smcv@debian.org>
Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/2919
This commit is contained in:
Simon McVittie 2020-07-09 16:57:42 +01:00
parent 0ebceebe37
commit b4d120fcb4
2 changed files with 4 additions and 4 deletions

View File

@ -491,10 +491,10 @@ resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --gener
gdkresources.h: gdk.gresource.xml gdkresources.h: gdk.gresource.xml
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \
--sourcedir=$(srcdir) --c-name _gdk --generate-header --manual-register --sourcedir=$(srcdir) --c-name _gdk --generate-header --manual-register --internal
gdkresources.c: gdk.gresource.xml $(resource_files) gdkresources.c: gdk.gresource.xml $(resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \
--sourcedir=$(srcdir) --c-name _gdk --generate-source --manual-register --sourcedir=$(srcdir) --c-name _gdk --generate-source --manual-register --internal
# ------------------- MSVC Build Items ---------------- # ------------------- MSVC Build Items ----------------
MSVCPROJS = gdk-3 MSVCPROJS = gdk-3

View File

@ -1421,10 +1421,10 @@ resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --gener
gtkresources.h: gtk.gresource.xml gtkresources.h: gtk.gresource.xml
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register --target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register --internal
gtkresources.c: gtk.gresource.xml $(resource_files) gtkresources.c: gtk.gresource.xml $(resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register --target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register --internal
gtkprivatetypebuiltins.h: stamp-gtkprivatetypebuiltins.h gtkprivatetypebuiltins.h: stamp-gtkprivatetypebuiltins.h
@true @true