-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathjustfile
31 lines (25 loc) · 1.16 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
set shell := ["nu", "-c"]
set dotenv-load
build *flags:
^cargo build {{flags}}
run *flags:
^cargo run {{flags}}
example name *flags:
with-env { RUST_BACKTRACE: 1 } { ^cargo run --example {{name}} {{flags}} }
example-rel name *flags:
with-env { RUST_BACKTRACE: 1 } { ^cargo run --release --example {{name}} {{flags}} }
expand example:
^cargo expand --example {{example}}
wasm-example name *wasmtime_flags:
with-env { \
CARGO_TARGET_WASM32_WASI_LINKER: $"($env.WASI_SDK_PATH)/bin/wasm-ld" \
CC_wasm32-wasi: $"($env.WASI_SDK_PATH)/bin/clang" \
AR_wasm32-wasi: $"($env.WASI_SDK_PATH)/bin/llvm-ar" \
RANLIB_wasm32-wasi: $"($env.WASI_SDK_PATH)/bin/llvm-ranlib" \
CFLAGS_wasm32-wasi: "-D_WASI_EMULATED_PROCESS_CLOCKS" \
CARGO_TARGET_WASM32_WASI_RUSTFLAGS: $"-C link-args=-L($env.WASI_SDK_PATH)/share/wasi-sysroot/lib/wasm32-wasi" \
BINDGEN_EXTRA_CLANG_ARGS_wasm32-wasi: $"--sysroot=($env.WASI_SDK_PATH)/share/wasi-sysroot -fvisibility=default" \
CARGO_TARGET_WASM32_WASI_RUNNER: "wasmtime -Scommon {{wasmtime_flags}}" \
} { \
^cargo run --example {{name}} --target wasm32-wasi \
}