[gobject-introspection] autotools: don't pass all the libregress cflags to the scanner. Fixes #226



commit 329b71b7400b8bcf387a8c5551356ab9d76584b8
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sat Jan 12 10:35:40 2019 +0100

    autotools: don't pass all the libregress cflags to the scanner. Fixes #226
    
    They contain things like -fvisibility=hidden which, in case of building with
    CFLAGS="-flto -O2" LDFLAGS="-Wl,--as-needed -flto", results in the linker
    throwing out unused symbols and not linking the dumper against libregress.
    
    This results in errors like:
      Invalid GType function: 'regress_test_enum_get_type'
      Failed to find symbol 'regress_test_enum_get_type'
    
    Fix this by only passing the required CFLAGS to the scanner instead.

 tests/scanner/Makefile.am | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index 89bfed90..fccbd352 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -91,7 +91,10 @@ GIRS += SLetter-1.0.gir
 
 Regress-1.0.gir: $(top_builddir)/Gio-2.0.gir Utility-1.0.gir libregress.la
 Regress_1_0_gir_LIBS = libregress.la
-Regress_1_0_gir_CFLAGS = $(libregress_la_CPPFLAGS) $(libregress_la_CFLAGS) -include "glib.h"
+Regress_1_0_gir_CFLAGS = $(GI_SCANNER_CFLAGS)
+if !HAVE_CAIRO
+Regress_1_0_gir_CFLAGS += -D_GI_DISABLE_CAIRO
+endif
 Regress_1_0_gir_INCLUDES = Gio-2.0 Utility-1.0
 if HAVE_CAIRO
 Regress_1_0_gir_INCLUDES += cairo-1.0 


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