Check if we're on a big endian system and act upon it (#396)

master
Sascha Hanse 5 years ago committed by GitHub
parent 8817fc7b1c
commit 0e84c32468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      librocksdb-sys/build.rs

@ -174,6 +174,7 @@ fn build_rocksdb() {
fn build_snappy() { fn build_snappy() {
let target = env::var("TARGET").unwrap(); let target = env::var("TARGET").unwrap();
let endianness = env::var("CARGO_CFG_TARGET_ENDIAN").unwrap();
let mut config = cc::Build::new(); let mut config = cc::Build::new();
config.include("snappy/"); config.include("snappy/");
@ -187,6 +188,10 @@ fn build_snappy() {
config.flag("-std=c++11"); config.flag("-std=c++11");
} }
if endianness == "big" {
config.define("WORDS_BIGENDIAN", Some("1"));
}
config.file("snappy/snappy.cc"); config.file("snappy/snappy.cc");
config.file("snappy/snappy-sinksource.cc"); config.file("snappy/snappy-sinksource.cc");
config.file("snappy/snappy-c.cc"); config.file("snappy/snappy-c.cc");

Loading…
Cancel
Save