Skip to content

Commit c98c058

Browse files
committed
Add -mwin32 on Windows targets
1 parent f7b47d9 commit c98c058

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::io::Command;
22
use std::io::process::InheritFd;
33
use std::default::Default;
4+
use std::borrow::ToOwned;
45

56
/// Extra configuration to pass to gcc.
67
pub struct Config {
@@ -16,11 +17,17 @@ pub struct Config {
1617

1718
impl Default for Config {
1819
fn default() -> Config {
20+
let mut flags = Vec::new();
21+
22+
if cfg!(target_os = "windows") {
23+
flags.push("-mwin32".to_owned());
24+
}
25+
1926
Config {
2027
include_directories: Vec::new(),
2128
definitions: Vec::new(),
2229
objects: Vec::new(),
23-
flags: Vec::new(),
30+
flags: flags,
2431
}
2532
}
2633
}

0 commit comments

Comments
 (0)