Skip to content

Commit

Permalink
Use windows_subsystem = "windows"
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Apr 16, 2023
1 parent 61738b6 commit a6acab2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tempfile = "3"
toml = "0.7"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["wincon"] }
winreg = "0.11"

[target.'cfg(unix)'.dependencies]
Expand Down
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![forbid(unsafe_code)]
#![windows_subsystem = "windows"]

mod arguments;
mod build_kind;
Expand Down Expand Up @@ -32,6 +32,14 @@ use crate::error::{MainError, MainResult};
use sha1::{Digest, Sha1};

fn main() {
#[cfg(target_os = "windows")]
{
use winapi::um::wincon::{AttachConsole, ATTACH_PARENT_PROCESS};
unsafe {
AttachConsole(ATTACH_PARENT_PROCESS);
}
}

env_logger::init();

match try_main() {
Expand Down

0 comments on commit a6acab2

Please sign in to comment.