[virt-tools-list] [virt-viewer][PATCH 2/2] tests: Fix VPATH build

Michal Privoznik mprivozn at redhat.com
Sat Jun 4 10:29:49 UTC 2016


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 at redhat.com>
---
 tests/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index bd13188..c46711e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,6 +3,7 @@ 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) \
-- 
2.8.3




More information about the virt-tools-list mailing list