Skip to content

Commit

Permalink
Fix tests on big-endian targets
Browse files Browse the repository at this point in the history
Turns out liblzma wants to be compiled with options to indicate that
it's big endian!
  • Loading branch information
alexcrichton committed Aug 23, 2019
1 parent 0accaff commit f01c806
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lzma-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ fn main() {
build.flag("-std=c99").flag("-pthread");
}

if let Ok(s) = env::var("CARGO_CFG_TARGET_ENDIAN") {
if s == "big" {
build.define("WORDS_BIGENDIAN", None);
}
}

build.compile("liblzma.a");
}

Expand Down

0 comments on commit f01c806

Please sign in to comment.