Commit a22fcf77fd9729504ba7ab26198a3707b7d72780

Anonymous Maarten 2022-11-01T13:40:19

cmake: older emscripten releases have a broken FindOpenGL.cmake This is fixed since 3.1.10: https://github.com/emscripten-core/emscripten/commit/485a7b4d6f84d4bc3b594ff81d39b6b143c8d598#diff-034f4d123f23ec5493d0fbf28cba1c36e404a991f286c8d031a22799e4e8b0e5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c608f47..a396ad5 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -230,6 +230,9 @@ if(OPENGL_FOUND)
         target_link_libraries(testshader OpenGL::GL)
         target_link_libraries(testgl2 OpenGL::GL)
     else()
+        if(EMSCRIPTEN AND OPENGL_gl_LIBRARY STREQUAL "nul")
+            set(OPENGL_gl_LIBRARY GL)
+        endif()
         # emscripten's FindOpenGL.cmake does not create OpenGL::GL
         target_link_libraries(testshader ${OPENGL_gl_LIBRARY})
         target_link_libraries(testgl2 ${OPENGL_gl_LIBRARY})