diff options
| author | Hristo Iliev <[email protected]> | 2022-11-30 11:36:01 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-11-30 10:36:01 +0100 |
| commit | 387c06000618ef0aa3b15c5e46d1c525ba194c50 (patch) | |
| tree | 898eed3cd69e6bde1f7699ba481e439d41ffd37b /src/CMakeLists.txt | |
| parent | 0b6d4b376ff8926c5916aace66b8778b768955b2 (diff) | |
| download | raylib-387c06000618ef0aa3b15c5e46d1c525ba194c50.tar.gz raylib-387c06000618ef0aa3b15c5e46d1c525ba194c50.zip | |
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
Diffstat (limited to 'src/CMakeLists.txt')
| -rw-r--r-- | src/CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 21cd3d3f..690f970a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,7 +38,9 @@ set(raylib_sources ) # <root>/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} |
