summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGangzheng Tong <tonggangzheng@gmail.com>2025-09-17 12:28:11 -0700
committerGitHub <noreply@github.com>2025-09-17 19:28:11 +0000
commit206f6cf5657177dfec9113d1f1b88b685eb2b75a (patch)
treebb2895af73855b2f50d76fb0982a42fb46b82c18
parent58060d2f7e86427124551f3f6edcf05bf6e4d229 (diff)
Add WASM FS module support for slang-playground (#8459)
Add WASM FS module support for slang-playground This change adds the necessary Emscripten build flags to export the FileSystem (FS) module interface in the slang-wasm build: - Adds -sMODULARIZE=1 to enable modular builds - Adds -sEXPORTED_RUNTIME_METHODS=['FS'] to export the FS interface These changes are required to support the slang-playground. The existing flags are also reformatted for better readability. Related to https://github.com/shader-slang/slang-playground/issues/170
-rw-r--r--source/slang-wasm/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang-wasm/CMakeLists.txt b/source/slang-wasm/CMakeLists.txt
index 152ed5094..3523b8aa4 100644
--- a/source/slang-wasm/CMakeLists.txt
+++ b/source/slang-wasm/CMakeLists.txt
@@ -24,6 +24,11 @@ if(EMSCRIPTEN)
# To generate binding code
target_link_options(
slang-wasm
- PUBLIC "--bind" "--emit-tsd" "interface.d.ts" "-s" "EXPORT_ES6=1"
+ PUBLIC
+ "--bind"
+ "--emit-tsd" "interface.d.ts"
+ "-sEXPORT_ES6=1"
+ "-sMODULARIZE=1"
+ "-sEXPORTED_RUNTIME_METHODS=['FS']"
)
endif()