From eff41b41680b8d7ef6dbf49c9b3778e5108f14bb Mon Sep 17 00:00:00 2001 From: David Konsumer Date: Sun, 7 Jul 2024 18:34:14 -0700 Subject: [PATCH] automate host-binding --- CMakeLists.txt | 4 ++-- test.htm | 30 +++++++++++++++++++----------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dbb900..e775c4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,9 +14,9 @@ endif() set(CMAKE_EXECUTABLE_SUFFIX ".mjs") add_executable(${PROJECT_NAME}-host host.c) -target_link_options(${PROJECT_NAME}-host PRIVATE -sINITIAL_MEMORY=512MB -sEXPORTED_FUNCTIONS=@${CMAKE_CURRENT_SOURCE_DIR}/host.txt -sEXPORTED_RUNTIME_METHODS=wasmMemory) +target_link_options(${PROJECT_NAME}-host PRIVATE -sINITIAL_MEMORY=128MB -sEXPORTED_FUNCTIONS=@${CMAKE_CURRENT_SOURCE_DIR}/host.txt -sEXPORTED_RUNTIME_METHODS=wasmMemory) # normally I would do this without emscripten, but this makes it a bit easier add_executable(${PROJECT_NAME}-cart cart.c) -target_link_options(${PROJECT_NAME}-cart PRIVATE -sWARN_ON_UNDEFINED_SYMBOLS=0 -sTOTAL_MEMORY=512MB --no-entry -sMODULARIZE -sEXPORTED_FUNCTIONS=@${CMAKE_CURRENT_SOURCE_DIR}/cart.txt -Wl,--import-memory -sSTANDALONE_WASM) +target_link_options(${PROJECT_NAME}-cart PRIVATE -sWARN_ON_UNDEFINED_SYMBOLS=0 -sTOTAL_MEMORY=128MB --no-entry -sMODULARIZE -sEXPORTED_FUNCTIONS=@${CMAKE_CURRENT_SOURCE_DIR}/cart.txt -Wl,--import-memory -sSTANDALONE_WASM) diff --git a/test.htm b/test.htm index 28af291..e72522e 100644 --- a/test.htm +++ b/test.htm @@ -7,22 +7,30 @@ \ No newline at end of file