@@ -16,16 +16,21 @@ profile := 'debug'
1616# The architecture name to use for packages. Either 'amd64', 'arm64', or 'arm'.
1717arch := env_var_or_default("TARGETARCH", "amd64")
1818
19+ # The OS name to use for packages. Either 'linux' or 'windows'.
20+ os := "linux"
21+
1922# If an `_arch` is specified, then we change the default cargo `--target` to
2023# support cross-compilation. Otherwise, we use `rustup` to find the default.
21- _cargo-target := if arch == "amd64" {
24+ _cargo-target := if os + '-' + arch == "linux- amd64" {
2225 "x86_64-unknown-linux-musl"
23- } else if arch == "arm64" {
26+ } else if os + '-' + arch == "linux- arm64" {
2427 "aarch64-unknown-linux-musl"
25- } else if arch == "arm" {
28+ } else if os + '-' + arch == "linux- arm" {
2629 "armv7-unknown-linux-musleabihf"
30+ } else if os + '-' + arch == "windows-amd64" {
31+ "x86_64-pc-windows-gnu"
2732 } else {
28- `rustup show | sed -n 's/^Default host: \(.*\)/\1/p'`
33+ error("unsupported: os=" + os + " arch=" + arch)
2934 }
3035
3136_target-dir := "target" / _cargo-target / profile
@@ -34,7 +39,7 @@ _target-bin := _target-dir / crate
3439_package-name := crate + "-" + version + "-" + arch
3540_package-tgz := "target/package" / _package-name + ".tgz"
3641_package-dir := "target/package" / _package-name
37- _package-bin := _package-dir / crate
42+ _package-bin := _package-dir / crate + if os == 'windows' { '.exe' } else { '' }
3843_package-dbg := _package-bin + ".dbg"
3944
4045_cargo := 'just-cargo profile=' + profile + ' target=' + _cargo-target
0 commit comments