Skip to content

Commit

Permalink
dont show console window in release binary
Browse files Browse the repository at this point in the history
  • Loading branch information
bearice committed Nov 16, 2021
1 parent b201e34 commit 13da0a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ use winres::WindowsResource;
fn main() -> io::Result<()> {
#[cfg(windows)]
{
let profile = std::env::var("PROFILE").unwrap();
if profile == "release" {
println!("cargo:rustc-cfg=release");
}
let mut res = WindowsResource::new();
// This path can be absolute, or relative to your crate root.
res.set_icon("assets/appIcon.ico");
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// #![windows_subsystem = "windows"]
#![cfg_attr(release, windows_subsystem = "windows")]

use core::mem::MaybeUninit;
use std::{
Expand Down

0 comments on commit 13da0a4

Please sign in to comment.