Fix -Wshadow warnings
[babeltrace.git] / src / bindings / python / bt2 / Makefile.am
index c74988b14819dc8dd3497deed0ab21aa0c5e551c..cc0ded098e8638f9254f9b31e2e72bcfbebadbae 100644 (file)
@@ -101,8 +101,15 @@ GENERATED_BINDINGS_DEPS =  \
        bt2/version.py          \
        setup.py
 
+# Some versions of SWIG (like 3.0.12) generate code where a parameter called
+# `swig_this` shadows a global of the same name.  Later versions (like 4.0.1)
+# have renamed this global to `Swig_This_global`.
+#
+# Disable -Wshadow for that file.
+WARN_CFLAGS = -Wno-shadow
+
 BUILD_FLAGS=CC="$(CC)" \
-               CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS)" \
+               CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(WARN_CFLAGS)" \
                CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS) -I$(srcdir)/bt2" \
                LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS) $(GLIB_LIBS) $(LIBS)"
 
@@ -126,7 +133,9 @@ swig_verbose_ = $(swig_verbose_@AM_DEFAULT_V@)
 swig_verbose_0 = @echo "  SWIG     " $@;
 
 $(builddir)/bt2/native_bt.c: $(SWIG_INTERFACE_FILES)
-       $(swig_verbose)$(SWIG) -python -I"$(top_srcdir)/include" -o "$@" "$<"
+       $(swig_verbose)$(SWIG) -MD -python -I"$(top_srcdir)/include" -o "$@" "$<"
+
+-include bt2/native_bt.d
 
 install-exec-local: build-python-bindings.stamp
        @opts="--prefix=$(prefix) --record $(INSTALLED_FILES) --verbose --no-compile $(DISTSETUPOPTS)"; \
@@ -158,4 +167,9 @@ uninstall-local:
 EXTRA_DIST = $(STATIC_BINDINGS_DEPS) $(SWIG_INTERFACE_FILES) $(STATIC_NATIVE_LIB_SRCS)
 
 # clean: generated C and Python files (by SWIG)
-CLEANFILES = bt2/native_bt.py bt2/native_bt.c build-python-bindings.stamp copy-static-deps.stamp
+CLEANFILES = \
+       build-python-bindings.stamp \
+       bt2/native_bt.c \
+       bt2/native_bt.d \
+       bt2/native_bt.py \
+       copy-static-deps.stamp
This page took 0.024329 seconds and 4 git commands to generate.