Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rem =============== <><> Infinity Web Assembly SDK makefile (batch file for now)
- rem Debug info please
- set EXTRA_COMPILE_OPTIONS=-g
- rem ======= Configure =======
- rem WASI delivers standard c/c++ runtime libraries
- rem Latest wasi-sdk here : https://github.com/WebAssembly/wasi-sdk/releases
- rem Docs : https://wasi.dev
- set WASI_LIB=..\..\sys\wasi\lib\wasm32-wasi
- set WASI_H=..\..\sys\wasi\include
- set WASI_CPP_H=..\..\sys\wasi\include\c++\v1
- rem <><> Infinty/XSG DOM interop/bootstrap headers
- set INFINITY_H=..\..\sys\infinity
- set COMPILE_OPTIONS=%EXTRA_COMPILE_OPTIONS% --target=wasm32 -fno-exceptions -c
- set HEADERS=-I%WASI_H% -I%WASI_CPP_H% -I%INFINITY_H%
- rem ======= Compile =======
- mkdir obj
- clang %HEADERS% %COMPILE_OPTIONS% ./source/app.cpp -o ./obj/app.o
- rem ======= Link =======
- set LINK_OPTIONS=-no-entry --allow-undefined --export=init --export=process --export=terminate --export=move --export=button
- set LIBS= %WASI_LIB%\libc.a %WASI_LIB%\libc++abi.a %WASI_LIB%\libc++.a
- wasm-ld %LINK_OPTIONS% %LIBS% ./obj/app.o -o ./obj/app.wasm
- rem ======= Inspect =======
- rem optional, convert to wat (text format) for manual inspection if difficulties arise.
- rem wasm2wat available here : https://github.com/WebAssembly/wabt/releases
- rem wasm2wat ./obj/app.wasm > ./obj/app.wat
- rem ======= Install =======
- rem push wasm binary into appropriate website directory for execution.
- copy .\obj\app.wasm ..\..\website\simple\_action
Advertisement
Add Comment
Please, Sign In to add comment