-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update build.yml * bump version * move size optimized release profile to cargo config * strip true * use correct output folder * whitespace --------- Co-authored-by: Bela Stoyan <bela.stoyan@gmail.com>
- Loading branch information
Showing
4 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
[target.x86_64-pc-windows-msvc] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
|
||
# These are some variables that configure the build so that the binary size is reduced. | ||
# Inspiration was taken from this blog: https://arusahni.net/blog/2020/03/optimizing-rust-binary-size.html | ||
# They only enable it on main and releases. | ||
[profile.release-min-size] | ||
inherits = "release" | ||
# Enable Link Time Optimization (LTO) for our release builds. This increases link time but drastically reduces | ||
# binary size. | ||
lto = true | ||
# Use a single code gen unit. This effectively disables parallel linking but ensures that everything is linked | ||
# together in a single unit which reduces the file-size at the cost of link time. | ||
# Default for a release build is 16 | ||
codegen-units = 1 | ||
# Strip the binaries. This reduces the filesize of the final release. | ||
strip = true | ||
# Optimize the binary for size. This reduces the filesize at the cost of a slower binary. | ||
opt-level = "z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters