Просмотр исходного кода

Borrow Cargo.toml's `profile.release` from RustDesk for better binary (#481)

XLion 1 год назад
Родитель
Сommit
4c74586ce0
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      Cargo.toml

+ 10 - 0
Cargo.toml

@@ -58,3 +58,13 @@ hbb_common = { path = "libs/hbb_common" }
58 58
 [workspace]
59 59
 members = ["libs/hbb_common"]
60 60
 exclude = ["ui"]
61
+
62
+#https://github.com/johnthagen/min-sized-rust
63
+#https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles
64
+[profile.release]
65
+lto = true
66
+codegen-units = 1
67
+panic = 'abort'
68
+strip = true
69
+#opt-level = 'z' # only have smaller size after strip # Default is 3, better performance
70
+#rpath = true # Not needed