|
|
@ -103,16 +103,26 @@ fn build_rocksdb() { |
|
|
|
// This is needed to enable hardware CRC32C. Technically, SSE 4.2 is
|
|
|
|
// This is needed to enable hardware CRC32C. Technically, SSE 4.2 is
|
|
|
|
// only available since Intel Nehalem (about 2010) and AMD Bulldozer
|
|
|
|
// only available since Intel Nehalem (about 2010) and AMD Bulldozer
|
|
|
|
// (about 2011).
|
|
|
|
// (about 2011).
|
|
|
|
config.define("HAVE_SSE42", Some("1")); |
|
|
|
let target_feature = env::var("CARGO_CFG_TARGET_FEATURE").unwrap(); |
|
|
|
|
|
|
|
let target_features: Vec<_> = target_feature.split(",").collect(); |
|
|
|
|
|
|
|
if target_features.contains(&"sse2") { |
|
|
|
config.flag_if_supported("-msse2"); |
|
|
|
config.flag_if_supported("-msse2"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if target_features.contains(&"sse4.1") { |
|
|
|
config.flag_if_supported("-msse4.1"); |
|
|
|
config.flag_if_supported("-msse4.1"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if target_features.contains(&"sse4.2") { |
|
|
|
config.flag_if_supported("-msse4.2"); |
|
|
|
config.flag_if_supported("-msse4.2"); |
|
|
|
|
|
|
|
config.define("HAVE_SSE42", Some("1")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if !target.contains("android") { |
|
|
|
if !target.contains("android") { |
|
|
|
|
|
|
|
if target_features.contains(&"pclmulqdq") { |
|
|
|
config.define("HAVE_PCLMUL", Some("1")); |
|
|
|
config.define("HAVE_PCLMUL", Some("1")); |
|
|
|
config.flag_if_supported("-mpclmul"); |
|
|
|
config.flag_if_supported("-mpclmul"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if target.contains("aarch64") { |
|
|
|
if target.contains("aarch64") { |
|
|
|
lib_sources.push("util/crc32c_arm64.cc") |
|
|
|
lib_sources.push("util/crc32c_arm64.cc") |
|
|
|