MSAgent-Chat/msagent.js/Makefile
modeco80 5c3433461d msagent.js: Rewrite decompression to use WASM
Mostly so it actually works. I couldn't get a fully JS version working and I can't be bothered to when this seems to work.

Note that yes, the wasm IS checked in to the repository. This is just so clang isn't a direct build dependency, but will be needed if the decompression module needs to be updated.
2024-07-09 18:53:18 -04:00

34 lines
548 B
Makefile

# Makefile for WASM decompression.
CXX = clang++ --target=wasm32
CXXFLAGS = -Wall \
-Os \
-nostdlib \
-fvisibility=hidden \
-std=c++20 \
-ffunction-sections \
-fdata-sections
src/decompress.wasm: obj/ obj/decompress.o
wasm-ld \
-o $@ \
--no-entry \
--strip-all \
--export-dynamic \
--allow-undefined \
--initial-memory=131072 \
--error-limit=0 \
--lto-O3 \
-O3 \
--gc-sections \
obj/decompress.o
obj/%.o: src/%.cpp
$(CXX) -c $(CXXFLAGS) $< -o $@
clean:
rm -rf obj src/decompress.wasm
obj/:
mkdir -p obj/