Skip to content

Commit

Permalink
Attempt to fix libgit2's MinGW build
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Sep 21, 2018
1 parent c0ab463 commit 9c1604e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libgit2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ fn main() {
if windows {
add_c_files(&mut cfg, "libgit2/src/win32".as_ref());
cfg.define("STRSAFE_NO_DEPRECATE", None);

// libgit2's build system claims that forks like mingw-w64 of MinGW
// still want this define to use C99 stdio functions automatically.
// Apparently libgit2 breaks at runtime if this isn't here? Who knows!
if target.contains("gnu") {
cfg.define("__USE_MINGW_ANSI_STDIO", "1");
}
} else {
add_c_files(&mut cfg, "libgit2/src/unix".as_ref());
cfg.flag("-fvisibility=hidden");
Expand Down

0 comments on commit 9c1604e

Please sign in to comment.