-
Notifications
You must be signed in to change notification settings - Fork 4
/
config-example.toml
37 lines (30 loc) · 1.9 KB
/
config-example.toml
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
# This is from https://github.com/bevyengine/bevy/blob/main/.cargo/config_fast_builds but modified.
# Explanation: https://bevyengine.org/learn/book/getting-started/setup/ - CTRL+F Enable Fast Compiles (Optional)
# To get faster compile times, rename this to config.toml and rust-toolchain-example.toml to rust-toolchain.toml
# You can use symlinks to get potential future updates - run these in project root:
# ln -s rust-toolchain-example.toml rust-toolchain.toml
# cd .cargo
# ln -s config-example.toml config.toml
# panic = "abort" disables unwind tables so backtraces are almost completely useless,
# if a panic happens inside library code, we don't even get names of our functions.
# To fix that, we use -Cforce-unwind-tables=y in .cargo/config.toml.
# https://github.com/rust-lang/rust/issues/81902
# NOTE: For maximum performance, you need a nightly compiler
# If you are using rust stable, remove the "-Zshare-generics=y" below.
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y", "-Cforce-unwind-tables=y"]
# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
# `brew install michaeleisel/zld/zld`
[target.x86_64-apple-darwin]
rustflags = ["-Clink-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y", "-Cforce-unwind-tables=y"]
[target.aarch64-apple-darwin]
rustflags = ["-Clink-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y", "-Cforce-unwind-tables=y"]
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-Zshare-generics=n", "-Cforce-unwind-tables=y"]
# Optional: bevy suggests reducing debug to 1 (line number tables), matklad / rust-analyzer suggests 0.
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
# Seems to have no effect for me on linux.
[profile.dev]
debug = 1