[cmake] pass emscripten options to consumer project

This commit is contained in:
Bruno Cabral 2025-09-11 17:43:42 -07:00
parent 13e5fa85d3
commit 8abcf45b03
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ include(CompilerFlags)
# Registers build options that are exposed to cmake # Registers build options that are exposed to cmake
include(CMakeOptions.txt) include(CMakeOptions.txt)
if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM") if (UNIX AND NOT APPLE AND NOT "${PLATFORM}" MATCHES "DRM" AND NOT "${PLATFORM}" MATCHES "Web")
if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11) if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11)
MESSAGE(FATAL_ERROR "Cannot disable both Wayland and X11") MESSAGE(FATAL_ERROR "Cannot disable both Wayland and X11")
endif() endif()

View File

@ -69,7 +69,7 @@ else()
endif() endif()
if (${PLATFORM} MATCHES "Web") if (${PLATFORM} MATCHES "Web")
target_link_options(raylib PUBLIC "-sUSE_GLFW=3") target_link_options(raylib PUBLIC "-sUSE_GLFW=3" -sEXPORTED_RUNTIME_METHODS=ccall -sASYNCIFY)
if(${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES3") if(${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES3")
target_link_options(raylib PUBLIC "-sMIN_WEBGL_VERSION=2") target_link_options(raylib PUBLIC "-sMIN_WEBGL_VERSION=2")
target_link_options(raylib PUBLIC "-sMAX_WEBGL_VERSION=2") target_link_options(raylib PUBLIC "-sMAX_WEBGL_VERSION=2")