From 4c74586ce099c6ccdb17574571327e3c7cf80244 Mon Sep 17 00:00:00 2001 From: XLion Date: Mon, 14 Oct 2024 11:00:38 +0800 Subject: [PATCH] Borrow Cargo.toml's `profile.release` from RustDesk for better binary (#481) --- Cargo.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 21fc575..c8ba248 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,3 +58,13 @@ hbb_common = { path = "libs/hbb_common" } [workspace] members = ["libs/hbb_common"] exclude = ["ui"] + +#https://github.com/johnthagen/min-sized-rust +#https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles +[profile.release] +lto = true +codegen-units = 1 +panic = 'abort' +strip = true +#opt-level = 'z' # only have smaller size after strip # Default is 3, better performance +#rpath = true # Not needed