-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
37 lines (26 loc) · 1.25 KB
/
justfile
File metadata and controls
37 lines (26 loc) · 1.25 KB
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
32
33
34
35
36
37
default: build
lto := "ON"
build-dir := "target"
wasi-sdk := "/opt/wasi-sdk"
default-example := "echo"
type := "Release"
# Both are here because `target` might still be generated by e.g. rust-analyzer
# externally, even if `{{build-dir}}` changes
clean:
rm -rf .cache {{ build-dir }} target
example name=default-example: (build-example name)
fastly compute serve -C examples --file ../{{ build-dir }}/examples/{{ name }}.wasm
strip-example name=default-example: (build-example name)
{{ wasi-sdk }}/bin/strip ./{{ build-dir }}/examples/{{ name }}.wasm
build-example name=default-example: (cmake-example name)
cmake --build {{ build-dir }}/examples
cmake-example name=default-example:
cmake -S ./examples -B {{ build-dir }}/examples -DEXAMPLE_NAME={{ name }} -DENABLE_LTO={{ lto }} -DCMAKE_BUILD_TYPE={{ type }} -DCMAKE_TOOLCHAIN_FILE={{ wasi-sdk }}/share/cmake/wasi-sdk-p1.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1
docs: build
doxygen
build: cmake
cmake --build {{ build-dir }}
test: build
ctest --test-dir {{ build-dir }} --output-on-failure
cmake:
cmake -S . -B {{ build-dir }} -DENABLE_LTO={{ lto }} -DCMAKE_BUILD_TYPE={{ type }} -DCMAKE_TOOLCHAIN_FILE={{ wasi-sdk }}/share/cmake/wasi-sdk-p1.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1