From eb590c7f47d22d5887cae759408e5745981d9246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 27 Sep 2015 21:58:27 +0200 Subject: [PATCH] Make it possible to run GL tests on Windows/EGL. --- CMakeLists.txt | 9 +++++++-- src/Magnum/Test/AbstractOpenGLTester.h | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea6265ae1..d4155af6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,8 +189,13 @@ if(BUILD_GL_TESTS) set(WITH_WINDOWLESSGLXAPPLICATION ON) set(GL_TEST_LIBRARIES Magnum MagnumWindowlessGlxApplication) elseif(CORRADE_TARGET_WINDOWS) - set(WITH_WINDOWLESSWGLAPPLICATION ON) - set(GL_TEST_LIBRARIES Magnum MagnumWindowlessWglApplication) + if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES) + set(WITH_WINDOWLESSWGLAPPLICATION ON) + set(GL_TEST_LIBRARIES Magnum MagnumWindowlessWglApplication) + else() + set(WITH_WINDOWLESSWINDOWSEGLAPPLICATION ON) + set(GL_TEST_LIBRARIES Magnum MagnumWindowlessWindowsEglApplication) + endif() else() message(FATAL_ERROR "Cannot run tests for OpenGL code on this platform. Set BUILD_GL_TESTS to OFF to skip building them.") endif() diff --git a/src/Magnum/Test/AbstractOpenGLTester.h b/src/Magnum/Test/AbstractOpenGLTester.h index c427357fa..460306383 100644 --- a/src/Magnum/Test/AbstractOpenGLTester.h +++ b/src/Magnum/Test/AbstractOpenGLTester.h @@ -37,8 +37,12 @@ #elif defined(CORRADE_TARGET_UNIX) && (!defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_DESKTOP_GLES)) #include "Magnum/Platform/WindowlessGlxApplication.h" #elif defined(CORRADE_TARGET_WINDOWS) +#if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_DESKTOP_GLES) #include "Magnum/Platform/WindowlessWglApplication.h" #else +#include "Magnum/Platform/WindowlessWindowsEglApplication.h" +#endif +#else #error cannot run OpenGL tests on this platform #endif @@ -101,7 +105,7 @@ std::optional AbstractOpenGLTester:: } \ int main(int argc, char** argv) { \ Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv, nullptr); \ - return Magnum::Platform::WindowlessWglApplication::create(windowProcedure); \ + return Magnum::Platform::WindowlessApplication::create(windowProcedure); \ } #endif