Skip to content

Instantly share code, notes, and snippets.

@Ujang360
Created March 8, 2020 04:04
Show Gist options
  • Save Ujang360/8f413a44a54d774d4d09fb584432b559 to your computer and use it in GitHub Desktop.
Save Ujang360/8f413a44a54d774d4d09fb584432b559 to your computer and use it in GitHub Desktop.
Rust build optimization template
[workspace]
members = [
"app0",
"lib0",
]
[profile.dev]
opt-level = 0
debug = true
rpath = false
lto = false
debug-assertions = true
codegen-units = 16
panic = 'unwind'
incremental = true
overflow-checks = true
[profile.release]
opt-level = 3
debug = false
rpath = false
lto = 'fat'
debug-assertions = false
codegen-units = 1
panic = 'abort'
incremental = false
overflow-checks = false
[profile.test]
opt-level = 0
debug = 2
rpath = false
lto = false
debug-assertions = true
codegen-units = 16
incremental = true
overflow-checks = true
[profile.bench]
opt-level = 3
debug = false
rpath = false
lto = true
debug-assertions = false
codegen-units = 1
incremental = false
overflow-checks = false
# .cargo/config
[llvm]
ninja = true
static-libstdcpp = true
[install]
rustflags = ["--emit=asm", "-C link-arg=-s", "-C target-cpu=native"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment