From cdba73a99a87f7ce77ed610aae1d2679502649ea Mon Sep 17 00:00:00 2001 From: Haihua Hu Date: Mon, 27 Jun 2016 18:15:08 +0800 Subject: qmlglsink: Fix build error when don't have QPA installed. Check header file existance and wrap the header file include in the necessary #ifdef to avoid build error. https://bugzilla.gnome.org/show_bug.cgi?id=767553 --- configure.ac | 7 +++++-- ext/qt/qtitem.cc | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index dd621b556..7a75866d6 100644 --- a/configure.ac +++ b/configure.ac @@ -2844,7 +2844,10 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [ HAVE_QT_WINDOWING="no" QT_VERSION="`$PKG_CONFIG --modversion Qt5Core`" QPA_INCLUDE_PATH=`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui - AC_SUBST(QPA_INCLUDE_PATH) + AS_IF([test -f "$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [ + AC_SUBST(QPA_INCLUDE_PATH) + HAVE_QT_QPA_HEADER="yes" + ], [AC_MSG_NOTICE([Cannot find QPA])]) if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [ AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed]) @@ -2853,7 +2856,7 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [ HAVE_QT_WINDOWING="yes" ], [AC_MSG_NOTICE([Could not find Qt X11 integration])]) fi - if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then + if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1" -a "x$HAVE_QT_QPA_HEADER" = "xyes"; then PKG_CHECK_MODULES(QT_WAYLAND, Qt5WaylandClient, [ AC_DEFINE([HAVE_QT_WAYLAND], [], [Define if Qt Wayland integration is installed]) diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc index 67820b993..c306c6dbd 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -32,7 +32,6 @@ #include #include #include -#include #if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (HAVE_QT_X11) #include @@ -41,6 +40,7 @@ #endif #if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_WAYLAND) +#include #include #endif -- cgit v1.2.1