Parcourir la source

[build][cmake] Added emscripten build options (#5180)

* [cmake] export automatically raylib definitions and compile/link options

* [cmake] pass emscripten options to consumer project
pull/5184/head
Bruno Cabral il y a 4 mois
committed by GitHub
Parent
révision
71321d179b
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: B5690EEEBB952194
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. +1
    -1
      CMakeLists.txt
  2. +1
    -1
      src/CMakeLists.txt

+ 1
- 1
CMakeLists.txt Voir le fichier

@ -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()

+ 1
- 1
src/CMakeLists.txt Voir le fichier

@ -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")

Chargement…
Annuler
Enregistrer