Build script for venvlauncher Sets the Windows subsystem to GUI for venvwlauncher variants. Only MSVC toolchain is supported on Windows (same as CPython).
()
| 4 | //! Only MSVC toolchain is supported on Windows (same as CPython). |
| 5 | |
| 6 | fn main() { |
| 7 | let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); |
| 8 | let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default(); |
| 9 | |
| 10 | // Only apply on Windows with MSVC toolchain |
| 11 | if target_os == "windows" && target_env == "msvc" { |
| 12 | let exe_name = std::env::var("CARGO_BIN_NAME").unwrap_or_default(); |
| 13 | |
| 14 | // venvwlauncher and venvwlaunchert should be Windows GUI applications |
| 15 | // (no console window) |
| 16 | if exe_name.contains("venvw") { |
| 17 | println!("cargo:rustc-link-arg=/SUBSYSTEM:WINDOWS"); |
| 18 | println!("cargo:rustc-link-arg=/ENTRY:mainCRTStartup"); |
| 19 | } |
| 20 | } |
| 21 | } |