Optimizing size of the final executable

This commit is contained in:
VC
2021-04-20 11:38:50 +02:00
parent 09ed837a1b
commit c52fc52d23
2 changed files with 10 additions and 4 deletions

View File

@@ -3,10 +3,9 @@ stages:
rust-latest: rust-latest:
stage: build stage: build
artifacts:
- target/release/scootaloo
image: rust:latest image: rust:latest
script: script:
- cargo build --verbose
- cargo build --release --verbose - cargo build --release --verbose
- strip target/release/${CI_PROJECT_NAME}
- du -h target/release/${CI_PROJECT_NAME}

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "scootaloo" name = "scootaloo"
version = "0.3.2" version = "0.3.3"
authors = ["VC <veretcle+framagit@mateu.be>"] authors = ["VC <veretcle+framagit@mateu.be>"]
edition = "2018" edition = "2018"
@@ -17,3 +17,10 @@ reqwest = "^0.11"
htmlescape = "^0.3" htmlescape = "^0.3"
log = "^0.4" log = "^0.4"
simple_logger = "^1.11" simple_logger = "^1.11"
[profile.release]
opt-level = 's' # Optimize for size.
lto = true # Link Time Optimization (LTO)
codegen-units = 1 # Set this to 1 to allow for maximum size reduction optimizations:
panic = 'abort' # removes the need for this extra unwinding code.