mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-03-23 04:11:00 +08:00
Javascript bindings (#14)
* Initial version ready - bindings are in `bindings/emscripten.cpp` - minimal Javascript example is in `examples/ggwave-js` * add npm package + add test-ggwave.js * js : rename export name to "ggwave_factory" * update to v0.1.5 * Update README.md * npm : add npm-publish target
This commit is contained in:
@@ -6,7 +6,14 @@ if (GGWAVE_SUPPORT_SDL2)
|
||||
# SDL2
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
set(CMAKE_CXX_FLAGS "-s TOTAL_MEMORY=67108864 -s USE_SDL=2 -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0 -s 'EXTRA_EXPORTED_RUNTIME_METHODS=[\"writeArrayToMemory\"]'")
|
||||
set(CMAKE_CXX_FLAGS " \
|
||||
--bind \
|
||||
-s TOTAL_MEMORY=67108864 \
|
||||
-s USE_SDL=2 \
|
||||
-s ASSERTIONS=1 \
|
||||
-s DISABLE_EXCEPTION_CATCHING=0 \
|
||||
-s 'EXTRA_EXPORTED_RUNTIME_METHODS=[\"writeArrayToMemory\"]' \
|
||||
")
|
||||
|
||||
unset(SDL2_INCLUDE_DIRS)
|
||||
unset(SDL2_LIBRARIES)
|
||||
@@ -65,19 +72,23 @@ endif()
|
||||
|
||||
# examples
|
||||
|
||||
add_subdirectory(ggwave-to-file)
|
||||
if (EMSCRIPTEN)
|
||||
add_subdirectory(ggwave-js)
|
||||
else()
|
||||
add_subdirectory(ggwave-to-file)
|
||||
endif()
|
||||
|
||||
if (GGWAVE_SUPPORT_SDL2)
|
||||
if (EMSCRIPTEN)
|
||||
# emscripten sdl2 examples
|
||||
|
||||
add_subdirectory(ggwave-wasm)
|
||||
add_subdirectory(waver)
|
||||
else()
|
||||
# non-emscripten sdl2 examples
|
||||
|
||||
add_subdirectory(ggwave-rx)
|
||||
add_subdirectory(ggwave-cli)
|
||||
add_subdirectory(waver)
|
||||
endif()
|
||||
|
||||
add_subdirectory(waver)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user