From 387c06000618ef0aa3b15c5e46d1c525ba194c50 Mon Sep 17 00:00:00 2001 From: Hristo Iliev Date: Wed, 30 Nov 2022 11:36:01 +0200 Subject: [PATCH] Fix an issue when compiling for web (#2820) It would try to use the glfw on the system but we're cross-compiling for web where the implementation is provided by emscripten's team --- src/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 21cd3d3f0..690f970a4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,7 +38,9 @@ set(raylib_sources ) # /cmake/GlfwImport.cmake handles the details around the inclusion of glfw -include(GlfwImport) +if (NOT ${PLATFORM} MATCHES "Web") + include(GlfwImport) +endif () # Sets additional platform options and link libraries for each platform # also selects the proper graphics API and version for that platform @@ -68,6 +70,10 @@ else() endif () endif() +if (${PLATFORM} MATCHES "Web") + target_link_options(raylib PRIVATE "-sUSE_GLFW=3") +endif() + set_target_properties(raylib PROPERTIES PUBLIC_HEADER "${raylib_public_headers}" VERSION ${PROJECT_VERSION}