Skip to content

Commit 71321d1

Browse files
authored
[build][cmake] Added emscripten build options (#5180)
* [cmake] export automatically raylib definitions and compile/link options * [cmake] pass emscripten options to consumer project
1 parent 7db5f56 commit 71321d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include(CompilerFlags)
2929
# Registers build options that are exposed to cmake
3030
include(CMakeOptions.txt)
3131

32-
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM")
32+
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM" AND NOT "${PLATFORM}" MATCHES "Web")
3333
if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11)
3434
MESSAGE(FATAL_ERROR "Cannot disable both Wayland and X11")
3535
endif()

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ else()
6969
endif()
7070

7171
if (${PLATFORM} MATCHES "Web")
72-
target_link_options(raylib PUBLIC "-sUSE_GLFW=3")
72+
target_link_options(raylib PUBLIC "-sUSE_GLFW=3" -sEXPORTED_RUNTIME_METHODS=ccall -sASYNCIFY)
7373
if(${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES3")
7474
target_link_options(raylib PUBLIC "-sMIN_WEBGL_VERSION=2")
7575
target_link_options(raylib PUBLIC "-sMAX_WEBGL_VERSION=2")

0 commit comments

Comments
 (0)