Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: optimize rust binary #111

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
"kind": "build",
"isDefault": true
}
},
{
"label": "clean",
"type": "shell",
"command": "cmd",
"args": ["/c", "del /s /q dist && cargo clean --manifest-path=./src-tauri/Cargo.toml"],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Cleans the dist folder and performs a cargo clean."
}
]
}
11 changes: 9 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ edition = "2021"
name = "openhome_lib"
crate-type = ["staticlib", "cdylib", "rlib"]

[profile.release]
panic = "abort" # Strip expensive panic clean-up logic
codegen-units = 1 # Compile crates one after another so the compiler can optimize better
lto = true # Enables link to optimizations
opt-level = "s" # Optimize for binary size
strip = true # Remove debug symbols

[build-dependencies]
tauri-build = { version = "2"}
tauri-build = { version = "2", features = [] }

[dependencies]
tauri = { version = "2.1.1" }
tauri = { version = "2.1.1", features = [] }
tauri-plugin-shell = "2.2.0"
serde = { version = "1.0.216", features = ["derive"] }
serde_json = "1.0.134"
Expand Down
Loading