Skip to content

Commit

Permalink
Manually merge skade#18 (by @Hoverbear)
Browse files Browse the repository at this point in the history
  • Loading branch information
skade authored Sep 20, 2020
1 parent dc68cdd commit 3cc75d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ fn build_leveldb(snappy_prefix: Option<PathBuf>) {
.define("LEVELDB_BUILD_BENCHMARKS", "OFF")
.define("CMAKE_INSTALL_LIBDIR", &libdir);
if let Some(snappy_prefix) = snappy_prefix {
#[cfg(target_env = "msvc")]
let ldflags = format!("/LIBPATH:{}", snappy_prefix.join(LIBDIR).display());
#[cfg(not(target_env = "msvc"))]
let ldflags = format!("-L{}", snappy_prefix.join(LIBDIR).display());

env::set_var(
"LDFLAGS",
format!("-L{}", snappy_prefix.join(LIBDIR).display()),
ldflags
);

config
.define("HAVE_SNAPPY", "ON")
.cflag(format!("-I{}", snappy_prefix.join("include").display()))
Expand Down

0 comments on commit 3cc75d5

Please sign in to comment.