mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
add windows icon logic to template.
This commit is contained in:
@@ -7,6 +7,7 @@ license = ""
|
||||
repository = ""
|
||||
default-run = "app"
|
||||
edition = "2018"
|
||||
build = "src/build.rs"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -19,6 +20,9 @@ phf = "0.7.24"
|
||||
includedir = "0.5.0"
|
||||
tauri = <%= tauriDep || `{ version = "0.2.0" }` %>
|
||||
|
||||
[target."cfg(windows)".build-dependencies]
|
||||
winres = "0.1"
|
||||
|
||||
[features]
|
||||
dev-server = [ "tauri/dev-server" ]
|
||||
embedded-server = [ "tauri/embedded-server" ]
|
||||
|
||||
12
cli/tauri.js/templates/src-tauri/src/build.rs
Normal file
12
cli/tauri.js/templates/src-tauri/src/build.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
#[cfg(windows)]
|
||||
extern crate winres;
|
||||
|
||||
#[cfg(windows)]
|
||||
fn main() {
|
||||
let mut res = winres::WindowsResource::new();
|
||||
res.set_icon("icons/icon.ico");
|
||||
res.compile().expect("Unable to find visual studio tools");
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user