Skip to content

Commit

Permalink
Fix is_flag_supported on msvc (#1336)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton authored Dec 31, 2024
1 parent e758ed1 commit 05a529c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,13 @@ impl Build {

cmd.arg(&src);

// On MSVC skip the CRT by setting the entry point to `main`.
// This way we don't need to add the default library paths.
if compiler.is_like_msvc() {
// Flags from _LINK_ are appended to the linker arguments.
cmd.env("_LINK_", "-entry:main");
}

let output = cmd.output()?;
let is_supported = output.status.success() && output.stderr.is_empty();

Expand Down

0 comments on commit 05a529c

Please sign in to comment.