2024-11-28 23:14:20 +03:00
|
|
|
set shell := ['nu', 'justfile.nu']
|
|
|
|
set export
|
2024-11-28 21:39:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
profile := 'dev'
|
2024-11-28 23:14:20 +03:00
|
|
|
host-target := `rustc -vV | lines | skip 1 | to text | from csv -s : --noheaders | reduce -f {} {|el, acc| $acc | upsert $el.column0 $el.column1 } | get host | str trim`
|
2024-11-28 21:39:18 +03:00
|
|
|
artifact-dir := 'addons/boids/lib'
|
|
|
|
|
2024-11-28 23:23:56 +03:00
|
|
|
_default: (_just-cmd '-l')
|
|
|
|
_setup-env:
|
2024-11-28 21:39:18 +03:00
|
|
|
mkdir -v {{artifact-dir}}
|
2024-11-28 23:23:56 +03:00
|
|
|
_just-cmd *FLAGS="":
|
2024-11-28 21:39:18 +03:00
|
|
|
@just -f {{justfile()}} {{FLAGS}}
|
|
|
|
|
2024-11-28 23:23:56 +03:00
|
|
|
build $target=(host-target) *FLAGS="": _setup-env
|
2024-11-28 21:39:18 +03:00
|
|
|
cd rust; cross build {{FLAGS}} --profile {{profile}} --target {{target}}
|
2024-11-28 23:23:56 +03:00
|
|
|
install $target=(host-target): _setup-env
|
2024-11-28 23:57:29 +03:00
|
|
|
mv -f rust/target/{{target}}/{{`$env.profiledir`}}/{{`$env.libprefix`}}boids.{{`$env.ext`}} {{artifact-dir}}/boids{{`$env.arch`}}.{{`$env.ext`}}
|
2024-11-28 23:23:56 +03:00
|
|
|
build-install target=(host-target) *FLAGS="": (build target FLAGS) (install target)
|
2024-11-28 23:14:20 +03:00
|
|
|
|
|
|
|
wasm: (build-install 'wasm32-unknown-emscripten' '+nightly' '-Zbuild-std')
|
|
|
|
windows: (build-install 'x86_64-pc-windows-msvc')
|
|
|
|
linux: (build-install 'x86_64-unknown-linux-gnu')
|
2024-11-28 23:23:56 +03:00
|
|
|
all: (_just-cmd '--timestamp' 'profile=release' 'linux' 'windows' 'wasm')
|
2024-11-28 21:39:18 +03:00
|
|
|
|
|
|
|
package:
|
|
|
|
run-external 'zip' '-r' 'boids-release.zip' 'addons' 'examples' 'README.md' 'LICENSE.txt'
|