From 206f6cf5657177dfec9113d1f1b88b685eb2b75a Mon Sep 17 00:00:00 2001 From: Gangzheng Tong Date: Wed, 17 Sep 2025 12:28:11 -0700 Subject: 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 --- source/slang-wasm/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source') 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() -- cgit v1.2.3