Skip to content

Commit 88eb074

Browse files
authored
Merge pull request #157 from vvanders/master
Fixing emscripten on windows to use the right files.
2 parents b4a2658 + 5791531 commit 88eb074

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

src/lib.rs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -860,11 +860,22 @@ impl Config {
860860
})
861861
.or_else(|| {
862862
if target.contains("emscripten") {
863-
if self.cpp {
864-
Some(Tool::new(PathBuf::from("em++")))
863+
//Windows uses bat file so we have to be a bit more specific
864+
let tool = if self.cpp {
865+
if cfg!(windows) {
866+
"em++.bat"
867+
} else {
868+
"em++"
869+
}
865870
} else {
866-
Some(Tool::new(PathBuf::from("emcc")))
867-
}
871+
if cfg!(windows) {
872+
"emcc.bat"
873+
} else {
874+
"emcc"
875+
}
876+
};
877+
878+
Some(Tool::new(PathBuf::from(tool)))
868879
} else {
869880
None
870881
}
@@ -992,7 +1003,14 @@ impl Config {
9921003
if self.get_target().contains("android") {
9931004
PathBuf::from(format!("{}-ar", self.get_target().replace("armv7", "arm")))
9941005
} else if self.get_target().contains("emscripten") {
995-
PathBuf::from("emar")
1006+
//Windows use bat files so we have to be a bit more specific
1007+
let tool = if cfg!(windows) {
1008+
"emar.bat"
1009+
} else {
1010+
"emar"
1011+
};
1012+
1013+
PathBuf::from(tool)
9961014
} else {
9971015
PathBuf::from("ar")
9981016
}

0 commit comments

Comments
 (0)