Fix the introspection build with "-Wl,--as-needed -flto -O2". Fixes #1692

The above flags in combination with "-fvisibility=hidden" break the
g-i build because it results in the g-i generated dumper executable not
linking against the libraries because they are detected as unused and
thrown out.

Fix by only using -fvisibility=hidden for the library and not g-i.
This commit is contained in:
Christoph Reiter 2019-03-25 09:46:06 +01:00
parent df5d18a5b1
commit 55e73682cc

View File

@ -30,7 +30,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/gdk \
$(GMODULE_CFLAGS) \
$(GTK_DEBUG_FLAGS) \
$(GDK_HIDDEN_VISIBILITY_CFLAGS) \
$(GTK_DEP_CFLAGS) \
$(INCLUDED_IMMODULE_DEFINE)
@ -1106,7 +1105,6 @@ gtk_use_quartz_private_h_sources = \
gtkquartz.h
if USE_QUARTZ
gtk_c_sources += $(gtk_use_quartz_c_sources)
libgtk_3_la_CFLAGS = "-xobjective-c"
gtk_private_h_sources += $(gtk_use_quartz_private_h_sources)
endif
@ -1472,10 +1470,15 @@ gtkunixprintinclude_HEADERS = $(gtk_unix_print_public_h_sources)
nodist_libgtk_3_la_SOURCES = $(nodist_gtk_c_sources)
libgtk_3_la_SOURCES = $(gtk_c_sources)
libgtk_3_la_CFLAGS = $(AM_CFLAGS) $(GDK_HIDDEN_VISIBILITY_CFLAGS)
libgtk_3_la_LDFLAGS = $(libtool_opts)
libgtk_3_la_LIBADD = $(libadd)
libgtk_3_la_DEPENDENCIES = $(deps)
if USE_QUARTZ
libgtk_3_la_CFLAGS += "-xobjective-c"
endif
if USE_WIN32
libgtk_3_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32
libgtk_3_la_LDFLAGS += -Wl,-luuid $(gtk_win32_res_ldflag)