mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
js: Add a CMake variable to control whether Emscripten emits WASM
I've finally got bored of keeping (and occasionally losing) a patch that turns it off unconditionally.
This commit is contained in:
@ -3,6 +3,9 @@ set(platform_gui_libs)
|
||||
set(platform_libs)
|
||||
set(CMAKE_EXECUTABLE_SUFFIX ".js")
|
||||
|
||||
set(WASM ON
|
||||
CACHE BOOL "Compile to WebAssembly rather than plain JavaScript")
|
||||
|
||||
set(emcc_export_list
|
||||
# Event handlers for mouse and keyboard input
|
||||
_mouseup
|
||||
@ -33,6 +36,11 @@ set(CMAKE_C_LINK_FLAGS "\
|
||||
-s ALLOW_MEMORY_GROWTH=1 \
|
||||
-s EXPORTED_FUNCTIONS='[${emcc_export_string}]' \
|
||||
-s EXTRA_EXPORTED_RUNTIME_METHODS='[cwrap,callMain]'")
|
||||
if(WASM)
|
||||
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -s WASM=1")
|
||||
else()
|
||||
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -s WASM=0")
|
||||
endif()
|
||||
|
||||
set(build_cli_programs FALSE)
|
||||
set(build_gui_programs FALSE)
|
||||
|
Reference in New Issue
Block a user