[PATCH weston 1/2] build: pass client flags to test programs

ppaalanen at gmail.com ppaalanen at gmail.com
Mon Feb 3 03:12:33 PST 2014


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Fix build failures of the kind:

  CC       tests/bad-buffer-test.o
In file included from tests/weston-test-client-helper.h:28:0,
                 from tests/bad-buffer-test.c:28:
./protocol/wayland-test-client-protocol.h:35:28: fatal error: wayland-client.h: No such file or directory
compilation terminated.
make[1]: *** [tests/bad-buffer-test.o] Error 1

These are only triggerable if libwayland has not been installed
system-wide, but only in a custom prefix.

Since the Makefile already uses AM_CPPFLAGS, simply add
TEST_CLIENT_CFLAGS to test programs instead of dropping AM_CPPFLAGS.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

---

Is this the right thing nowadays?
Or should the AM_CPPFLAGS content be dropped?
---
 Makefile.am | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 753ff83..1de22c9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -834,27 +834,34 @@ libtest_client_la_SOURCES =			\
 nodist_libtest_client_la_SOURCES =		\
 	protocol/wayland-test-protocol.c	\
 	protocol/wayland-test-client-protocol.h
+libtest_client_la_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
 libtest_client_la_LIBADD = $(TEST_CLIENT_LIBS) libshared.la libtest-runner.la
 
 bad_buffer_weston_SOURCES = tests/bad-buffer-test.c
+bad_buffer_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
 bad_buffer_weston_LDADD = libtest-client.la
 
 keyboard_weston_SOURCES = tests/keyboard-test.c
+keyboard_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
 keyboard_weston_LDADD = libtest-client.la
 
 event_weston_SOURCES = tests/event-test.c
+event_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
 event_weston_LDADD = libtest-client.la
 
 button_weston_SOURCES = tests/button-test.c
+button_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
 button_weston_LDADD = libtest-client.la
 
 text_weston_SOURCES = tests/text-test.c
 nodist_text_weston_SOURCES =			\
 	protocol/text-protocol.c		\
 	protocol/text-client-protocol.h
+text_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
 text_weston_LDADD = libtest-client.la
 
 subsurface_weston_SOURCES = tests/subsurface-test.c
+subsurface_weston_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CLIENT_CFLAGS)
 subsurface_weston_LDADD = libtest-client.la
 
 if ENABLE_EGL
-- 
1.8.3.2



More information about the wayland-devel mailing list