qt: build error using gbm backend with meson because gstreamer-1.0-gl does not contain -DMESA_EGL_NO_X11_HEADERS from eg.pc
While I compiling the the gst-plugins-good 1.16 qt module the following error occurred:
[183/229] Compiling C++ object 'ext/qt/2759a16@@gstqmlgl@sha/gstqtglutility.cc.o'.
FAILED: ext/qt/2759a16@@gstqmlgl@sha/gstqtglutility.cc.o
arm-v7a-linux-gnueabihf-g++ -Iext/qt/2759a16@@gstqmlgl@sha -Iext/qt -I../gst-plugins-good-1.16.0/ext/qt -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/qt5/QtGui/5.12.2/QtGui -I. -I../gst-plugins-good-1.16.0/ -I../gst-plugins-good-1.16.0/gst-libs -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/glib-2.0 -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/lib/glib-2.0/include -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/lib/libffi-3.2.1/include -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/gstreamer-1.0 -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/orc-0.4 -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/lib/gstreamer-1.0/include -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/qt5/QtQuick -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/qt5/QtGui -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/qt5/QtQml -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/qt5/QtNetwork -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/qt5/QtCore -I/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/qt5 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -O2 -g -Wmissing-declarations -Wredundant-decls -Wwrite-strings -Winit-self -Wmissing-include-dirs -Wno-multichar -Wvla -Wpointer-arith -fPIC -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -pthread -DHAVE_CONFIG_H -DHAVE_QT_QPA_HEADER -DHAVE_QT_EGLFS -MD -MQ 'ext/qt/2759a16@@gstqmlgl@sha/gstqtglutility.cc.o' -MF 'ext/qt/2759a16@@gstqmlgl@sha/gstqtglutility.cc.o.d' -o 'ext/qt/2759a16@@gstqmlgl@sha/gstqtglutility.cc.o' -c ../gst-plugins-good-1.16.0/ext/qt/gstqtglutility.cc
In file included from /home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/EGL/egl.h:39,
from /home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/gstreamer-1.0/gst/gl/egl/gstegl.h:44,
from ../gst-plugins-good-1.16.0/ext/qt/gstqtglutility.cc:43:
/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/EGL/eglplatform.h:124:10: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
In file included from /home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/EGL/egl.h:39,
from /home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/gstreamer-1.0/gst/gl/egl/gstegl.h:44,
from ../gst-plugins-good-1.16.0/ext/qt/gstqtglutility.cc:43:
/home/mfe/ws/bsps/OSELAS.BSP-Siedle-DCIP/platform-dcip/sysroot-target/usr/include/EGL/eglplatform.h:124:10: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
This happens because I use the gbm directly without X11 and Wayland.
A quick search shows that gstreamer-gl-1.0.pc
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/gstreamer-1.0
pluginsdir=${prefix}/lib/gstreamer-1.0
gl_platforms=egl
gl_winsys=gbm
gl_apis=gles2
Name: GStreamer OpenGL Plugins Libraries
Description: Streaming media framework, OpenGL plugins libraries
Version: 1.16.0.20190517-1
Requires: gstreamer-video-1.0 gstreamer-base-1.0 gstreamer-1.0
Libs: -L${libdir} -lgstgl-1.0
Cflags: -I${includedir} -I${libdir}/gstreamer-1.0/include
do not propagate the mesa switch found here egl.pc
prefix=${pcfiledir}/../..
libdir=${prefix}/lib
includedir=${prefix}/include
Name: egl
Description: Mesa EGL Library
Version: 19.0.2.20190517-1
Requires.private: libdrm >= 2.4.75
Libs: -L${libdir} -lEGL
Libs.private: -lpthread -pthread -lm -ldl
Cflags: -I${includedir} -DMESA_EGL_NO_X11_HEADERS
Now the eglplatform.h
will fall into the the X11 which is wrong.