paullouisageneau / datachannel-wasm

C++ WebRTC Data Channels and WebSockets for WebAssembly in browsers
MIT License
148 stars 25 forks source link

Add EXPORT_DYNCALL as a cmake option. #30

Closed hanseuljun closed 2 years ago

hanseuljun commented 2 years ago

Hi Paul-Louis,

This PR is for removing linker warning messages. When a project (e.g., mine haha) imports datachannel-wasm through multiple layers, for example: datachannel-wasm -> library A -> library B -> app

adding "SHELL:-s EXPORTED_RUNTIME_METHODS=[\"dynCall\"]" to datachannel-wasm causes emscripten to print the following message for every cpp file of library A and B:

em++: warning: linker setting ignored during compilation: 'EXPORTED_RUNTIME_METHODS' [-Wunused-command-line-argument]

This can be avoided by adding "SHELL:-s EXPORTED_RUNTIME_METHODS=[\"dynCall\"]" directly to app, instead of datachannel-wasm. This EXPORT_DYNCALL option allows such an approach.

Thanks for keep pushing this project forward!!

paullouisageneau commented 2 years ago

OK thanks!