fix windows builds (#4903)

This commit is contained in:
Evan Almloff authored and GitHub committed 2025-11-03 18:10:38 -08:00
1 parent 06f39cd140
commit e03d8ff215
1 file changed
+6 -1
+6 -1
View File
@@ -908,7 +908,7 @@ impl BuildRequest {
]);
}
// On windows, we pass /SUBSYSTbEM:WINDOWS to prevent a console from appearing
// On windows, we pass /SUBSYSTEM:WINDOWS to prevent a console from appearing
if matches!(bundle, BundleFormat::Windows)
&& !rustflags
.flags
@@ -922,6 +922,11 @@ impl BuildRequest {
rustflags
.flags
.push(format!("-Clink-arg=/SUBSYSTEM:{}", subsystem));
// We also need to set the entry point to mainCRTStartup to avoid windows looking
// for a WinMain function
rustflags
.flags
.push("-Clink-arg=/ENTRY:mainCRTStartup".to_string());
}
// Make sure we set the sysroot for ios builds in the event the user doesn't have it set