test: silence compiler warning for C++ build test
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 5 Jun 2014 23:38:35 +0000 (09:38 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 10 Jun 2014 10:54:53 +0000 (20:54 +1000)
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for
C/ObjC but not for C++ [enabled by default]

Since gcc also complains about adding -Wno-strict-prototypes we have to handle
the two separately. A side-effect here: now that we promote the GCC_CFLAGS to
AM_CFLAGS, litest.la is built with the correct CFLAGS too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
configure.ac
test/Makefile.am

index d8e3358aebb427c430e4b7312ead27ec92bb308b..13cf3a813ebddc037c021b1dee2959dde4162c46 100644 (file)
@@ -59,9 +59,11 @@ PKG_CHECK_MODULES(LIBUDEV, [libudev])
 PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
 
 if test "x$GCC" = "xyes"; then
-       GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden"
+       GCC_CXXFLAGS="-Wall -Wextra -Wno-unused-parameter -g -fvisibility=hidden"
+       GCC_CFLAGS="$GCC_CXXFLAGS -Wmissing-prototypes -Wstrict-prototypes"
 fi
 AC_SUBST(GCC_CFLAGS)
+AC_SUBST(GCC_CXXFLAGS)
 
 AC_PATH_PROG(DOXYGEN, [doxygen])
 if test "x$DOXYGEN" = "x"; then
index fa6d90d69506828eb57884bf7320dfb8950be435..53a33003a595d63498815a1b85e8c9c0539ede40 100644 (file)
@@ -4,8 +4,11 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
               $(CHECK_CFLAGS) \
               $(LIBEVDEV_CFLAGS)
 
+AM_CFLAGS = $(GCC_CFLAGS)
+AM_CXXFLAGS = $(GCC_CXXFLAGS)
+
 TEST_LIBS = liblitest.la $(CHECK_LIBS) $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS) $(top_builddir)/src/libinput.la -lm
-TEST_CFLAGS = $(GCC_CFLAGS) $(AM_CFLAGS)
+TEST_CFLAGS = $(AM_CFLAGS)
 noinst_LTLIBRARIES = liblitest.la
 liblitest_la_SOURCES = \
        $(top_srcdir)/src/libinput-util.h \