virt-viewer/tests/Makefile.am
Michal Privoznik 9f3029291d tests: Fix VPATH build
So test-hotkeys include virt-viewer-app.h which includes
virt-viewer-window.h which includes virt-viewer-display.h which
in turn wants to include virt-viewer-enums.h. But, the enums
header file is generated at build time into builddir not srcdir.
Therefore it may happen if the two are distinct that compiler
fails to find the enums file:

In file included from ../../src/virt-viewer-window.h:29:0,
                 from ../../src/virt-viewer-app.h:28,
                 from ../../tests/test-hotkeys.c:27:
../../src/virt-viewer-display.h:28:31: fatal error: virt-viewer-enums.h: No such file or directory
 #include "virt-viewer-enums.h"
                               ^
compilation terminated.

The fix is to include builddir into paths where header files are
looked for.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-04 20:20:45 +02:00

48 lines
921 B
Makefile

NULL =
AM_CPPFLAGS = \
-DLOCALE_DIR=\""$(datadir)/locale"\" \
-DG_LOG_DOMAIN=\"virt-viewer\" \
-I$(top_builddir)/src/ \
-I$(top_srcdir)/src/ \
-I$(top_srcdir)/tests/ \
$(GLIB2_CFLAGS) \
$(GTK_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
LDADD= \
$(top_builddir)/src/libvirt-viewer-util.la \
$(GLIB2_LIBS) \
$(GTK_LIBS) \
$(LIBXML2_LIBS) \
$(NULL)
TESTS = test-version-compare test-monitor-mapping test-hotkeys
check_PROGRAMS = $(TESTS)
test_version_compare_SOURCES = \
test-version-compare.c \
$(NULL)
test_monitor_mapping_SOURCES = \
test-monitor-mapping.c \
$(NULL)
test_hotkeys_SOURCES = \
test-hotkeys.c \
$(NULL)
test_hotkeys_LDADD = \
$(top_builddir)/src/libvirt-viewer.la \
$(LDADD) \
$(NULL)
if OS_WIN32
TESTS += redirect-test
redirect_test_SOURCES = redirect-test.c
redirect_test_LDFLAGS = -Wl,--subsystem,windows
redirect_test_CPPFLAGS = $(GLIB2_CFLAGS)
endif
-include $(top_srcdir)/git.mk