change-id = "ignore"

[build]
#cargo = "$MINGW_PREFIX/bin/cargo.exe"
#rustc = "$MINGW_PREFIX/bin/rustc.exe"
#rustfmt = "$MINGW_PREFIX/bin/rustfmt.exe"
#cargo-clippy = "$MINGW_PREFIX/bin/cargo-clippy.exe"
submodules = false
build = "$OSTYPE"
host = ["$OSTYPE"]
target = [
  "wasm32v1-none",
  "wasm32-unknown-unknown",
  "wasm32-unknown-emscripten",
  "wasm32-wasip1",
  "wasm32-wasip1-threads",
  "wasm32-wasip2",
]
build-dir = "build-$MSYSTEM"
python = "$MINGW_PREFIX/bin/python.exe"
locked-deps = true
vendor = true
extended = false
metrics = true
ccache = false

# Generating docs fails with the wasm32-* targets
docs = false

[install]
prefix = "$INSTALL_PREFIX"
sysconfdir = "etc"

[rust]
#debug = true
codegen-units = 1
codegen-units-std = 1
#debuginfo-level-std = 2
channel = "stable"
rpath = false
frame-pointers = true
llvm-bitcode-linker = false
use-lld = "external"
llvm-tools = false
codegen-tests = false
deny-warnings = false
backtrace-on-ice = true
remap-debuginfo = false
# FIXME: Control Flow Guard works only on gnullvm targets, in other cases it's ignored
# https://github.com/rust-lang/rust/pull/132965
control-flow-guard = true
new-symbol-mangling = true
#lto = "fat"

[dist]
compression-formats = ["gz"]
compression-profile = "fast"
include-mingw-linker = false

[target.$OSTYPE]
cc = "$MINGW_PREFIX/bin/clang.exe"
cxx = "$MINGW_PREFIX/bin/clang++.exe"
ar = "$MINGW_PREFIX/bin/llvm-ar.exe"
ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe"
linker = "$MINGW_PREFIX/bin/clang.exe"
llvm-config = "$MINGW_PREFIX/bin/llvm-config.exe"

[target.wasm32-unknown-unknown]
cc = "$MINGW_PREFIX/bin/clang.exe"
cxx = "$MINGW_PREFIX/bin/clang++.exe"
ar = "$MINGW_PREFIX/bin/llvm-ar.exe"
ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe"
linker = "$MINGW_PREFIX/bin/wasm-ld.exe"
default-linker = "wasm-ld.exe"

[target.wasm32-unknown-emscripten]
cc = "$MINGW_PREFIX/lib/emscripten/emcc.bat"
cxx = "$MINGW_PREFIX/lib/emscripten/em++.bat"
ar = "$MINGW_PREFIX/lib/emscripten/emar.bat"
ranlib = "$MINGW_PREFIX/lib/emscripten/emranlib.bat"
linker = "$MINGW_PREFIX/bin/wasm-ld.exe"
default-linker = "wasm-ld.exe"

[target.wasm32v1-none]
cc = "$MINGW_PREFIX/bin/clang.exe"
cxx = "$MINGW_PREFIX/bin/clang++.exe"
ar = "$MINGW_PREFIX/bin/llvm-ar.exe"
ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe"
linker = "$MINGW_PREFIX/bin/wasm-ld.exe"
default-linker = "wasm-ld.exe"

[target.wasm32-wasip1]
cc = "$MINGW_PREFIX/bin/clang.exe"
cxx = "$MINGW_PREFIX/bin/clang++.exe"
ar = "$MINGW_PREFIX/bin/llvm-ar.exe"
ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe"
linker = "$MINGW_PREFIX/bin/wasm-ld.exe"
default-linker = "wasm-ld.exe"
wasi-root = "$MINGW_PREFIX/share/wasi-sysroot"

[target.wasm32-wasip1-threads]
cc = "$MINGW_PREFIX/bin/clang.exe"
cxx = "$MINGW_PREFIX/bin/clang++.exe"
ar = "$MINGW_PREFIX/bin/llvm-ar.exe"
ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe"
linker = "$MINGW_PREFIX/bin/wasm-ld.exe"
default-linker = "wasm-ld.exe"
wasi-root = "$MINGW_PREFIX/share/wasi-sysroot"

[target.wasm32-wasip2]
cc = "$MINGW_PREFIX/bin/clang.exe"
cxx = "$MINGW_PREFIX/bin/clang++.exe"
ar = "$MINGW_PREFIX/bin/llvm-ar.exe"
ranlib = "$MINGW_PREFIX/bin/llvm-ranlib.exe"
linker = "$MINGW_PREFIX/bin/wasm-ld.exe"
default-linker = "wasm-ld.exe"
wasi-root = "$MINGW_PREFIX/share/wasi-sysroot"
