qt5multimedia: fix build issue with mesa3d w/out xcb

The mesa's EGL/eglplatform.h header includes X11 headers unless the flag
MESA_EGL_NO_X11_HEADERS is defined[1].

A build issue happens when mesa3d is selected as then OpenGL EGL backend
but the XCB library is not selected.

This commit tells qmake to pass the cflag MESA_EGL_NO_X11_HEADERS to
make and prevent from including the missing X headers.

The issue QTBUG-66233 is opened in the Qt tracker[1].

Fixes:

	In file included from
	/home/gportay/src/buildroot/output-qt5.10/host/x86_64-buildroot-linux-gnu/sysroot/usr/include/EGL/egl.h:39:0,
	                 from qsgvideonode_egl.h:48,
	                 from qsgvideonode_egl.cpp:40:
	/home/gportay/src/buildroot/output-qt5.10/host/x86_64-buildroot-linux-gnu/sysroot/usr/include/EGL/eglplatform.h:118:22:
	fatal error: X11/Xlib.h: No such file or directory
	 #include <X11/Xlib.h>
	                      ^
	compilation terminated.
	Makefile:550: recipe for target '.obj/qsgvideonode_egl.o' failed

[1]: 79ee1b2ff0/include/EGL/eglplatform.h (L109-L125)
[2]: https://bugreports.qt.io/browse/QTBUG-66233

[Peter: simplify logic]
Cc: Julien CORJON <corjon.j@ecagroup.com>
Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Gaël PORTAY 2018-02-11 23:25:23 -05:00 committed by Peter Korsgaard
parent e46f9fde78
commit fadaaabe6f

View File

@ -34,8 +34,15 @@ ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
QT5MULTIMEDIA_DEPENDENCIES += alsa-lib
endif
# The mesa's EGL/eglplatform.h header includes X11 headers unless the flag
# MESA_EGL_NO_X11_HEADERS is defined. Tell to not include X11 headers if
# the libxcb is not selected.
ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL)x$(BR2_PACKAGE_LIBXCB),yx)
QT5MULTIMEDIA_QMAKEFLAGS += QMAKE_CXXFLAGS+=-DMESA_EGL_NO_X11_HEADERS
endif
define QT5MULTIMEDIA_CONFIGURE_CMDS
(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake $(QT5MULTIMEDIA_QMAKEFLAGS))
endef
define QT5MULTIMEDIA_BUILD_CMDS