mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-07 17:54:39 +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:
24
bindings/javascript/CMakeLists.txt
Normal file
24
bindings/javascript/CMakeLists.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
set(TARGET libggwave)
|
||||
|
||||
add_executable(${TARGET}
|
||||
emscripten.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET} PRIVATE
|
||||
ggwave
|
||||
)
|
||||
|
||||
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \
|
||||
--bind \
|
||||
-s MODULARIZE=1 \
|
||||
-s SINGLE_FILE=1 \
|
||||
-s ALLOW_MEMORY_GROWTH=1 \
|
||||
-s EXPORT_NAME=\"'ggwave_factory'\" \
|
||||
")
|
||||
|
||||
add_custom_command(
|
||||
TARGET libggwave POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_BINARY_DIR}/bin/libggwave.js
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ggwave.js
|
||||
)
|
||||
Reference in New Issue
Block a user