From e7acdd12d8b02617728f11720725ca989fe2390b Mon Sep 17 00:00:00 2001 From: manuel5975p Date: Fri, 21 Jun 2024 09:07:01 +0200 Subject: [PATCH] [build] CMake: support OpenGL ES3 in `LibraryConfigurations.cmake` (#4079) * Allow ES3 in LibraryConfigurations.cmake * Put FULL_ES3 as linker option --- cmake/LibraryConfigurations.cmake | 4 +++- src/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index f6dd4f31..6d2250c7 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -58,7 +58,9 @@ if (${PLATFORM} MATCHES "Desktop") elseif (${PLATFORM} MATCHES "Web") set(PLATFORM_CPP "PLATFORM_WEB") - set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + if(NOT GRAPHICS) + set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + endif() set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") elseif (${PLATFORM} MATCHES "Android") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bfb4b05b..4ba1c700 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,6 +70,9 @@ endif() if (${PLATFORM} MATCHES "Web") target_link_options(raylib PUBLIC "-sUSE_GLFW=3") + if(${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES3") + target_link_options(raylib PUBLIC "-sFULL_ES3=1") + endif() endif() set_target_properties(raylib PROPERTIES