aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Balcer <piotr@balcer.eu>2019-01-20 14:49:22 +0100
committerPiotr Balcer <piotr@balcer.eu>2019-01-20 14:49:22 +0100
commit1bfa1b8696d45eba7cd4d3ab35d0486943c2b1bc (patch)
tree356c99fb03dd8c78fe1d5cf9cac2cbee309cda15
parent0d2cfce18edf8016b7ff865aafab25ee7a352507 (diff)
downloadraylib-1bfa1b8696d45eba7cd4d3ab35d0486943c2b1bc.tar.gz
raylib-1bfa1b8696d45eba7cd4d3ab35d0486943c2b1bc.zip
cmake: use ALLOW_MEMORY_GROWTH=1 for web examples
The default memory limit for emscripten applications is 16 mergabytes, which might be to little for some examples, especially given that the resources are also included in that limit. Normally, using this option disables some asm.js optimizations, but there's no such cost for WebAssembly.
-rw-r--r--examples/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 1d4fdd79..b9cd3ff5 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -56,7 +56,10 @@ if(${PLATFORM} MATCHES "Android")
elseif(${PLATFORM} MATCHES "Web")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1")
+ # Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/templates/web_shell/shell.html")
+
set(OUTPUT_EXT ".html")
endif()