Skip to content

Commit 532fcdb

Browse files
committed
cmake : fix emscripten
1 parent 5badf2a commit 532fcdb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ if (EMSCRIPTEN)
3535
set(BUILD_SHARED_LIBS_DEFAULT OFF)
3636

3737
option(WHISPER_WASM_SINGLE_FILE "whisper: embed WASM inside the generated whisper.js" ON)
38+
39+
# TODO: without these, we get the following error:
40+
# wasm-ld: error: --shared-memory is disallowed by whisper.cpp.o because it was not compiled with 'atomics' or 'bulk-memory' features.
41+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -s TOTAL_STACK=5242880")
42+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -s TOTAL_STACK=5242880")
3843
else()
3944
if (MINGW)
4045
set(BUILD_SHARED_LIBS_DEFAULT OFF)

0 commit comments

Comments
 (0)