From c4039a929c3f9808345af84d2e67bf15c41f6987 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 15 May 2020 16:46:03 -0700 Subject: [PATCH] Use a compile test for EGL support --- app/app.pro | 6 +----- config.tests/EGL/EGL.pro | 4 ++++ config.tests/EGL/main.cpp | 10 ++++++++++ moonlight-qt.pro | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 config.tests/EGL/EGL.pro create mode 100644 config.tests/EGL/main.cpp diff --git a/app/app.pro b/app/app.pro index 844fb112..9c3d11e3 100644 --- a/app/app.pro +++ b/app/app.pro @@ -90,10 +90,6 @@ unix:!macx { CONFIG += libva } - packagesExist(egl) { - CONFIG += egl - } - packagesExist(vdpau) { CONFIG += libvdpau } @@ -268,7 +264,7 @@ libdrm { SOURCES += streaming/video/ffmpeg-renderers/drm.cpp HEADERS += streaming/video/ffmpeg-renderers/drm.h } -egl { +config_EGL { message(EGL renderer selected) DEFINES += HAVE_EGL diff --git a/config.tests/EGL/EGL.pro b/config.tests/EGL/EGL.pro new file mode 100644 index 00000000..933fcecc --- /dev/null +++ b/config.tests/EGL/EGL.pro @@ -0,0 +1,4 @@ +SOURCES = main.cpp + +CONFIG += link_pkgconfig +PKGCONFIG += sdl2 egl \ No newline at end of file diff --git a/config.tests/EGL/main.cpp b/config.tests/EGL/main.cpp new file mode 100644 index 00000000..cc1ba8b4 --- /dev/null +++ b/config.tests/EGL/main.cpp @@ -0,0 +1,10 @@ +#include +#include + +#ifndef EGL_VERSION_1_5 +#error EGLRenderer requires EGL 1.5 +#endif + +#ifndef GL_ES_VERSION_2_0 +#error EGLRenderer requires OpenGL ES 2.0 +#endif \ No newline at end of file diff --git a/moonlight-qt.pro b/moonlight-qt.pro index 74b4c063..22f3ce82 100644 --- a/moonlight-qt.pro +++ b/moonlight-qt.pro @@ -22,3 +22,4 @@ CONFIG += debug_and_release # Run our compile tests load(configure) qtCompileTest(SL) +qtCompileTest(EGL)