Skip to content

Commit

Permalink
Merge pull request skade#9 from pizzamig/BSD-fix-link
Browse files Browse the repository at this point in the history
Bsd fix link phase
  • Loading branch information
skade authored Aug 12, 2019
2 parents 92ee859 + d2f25e4 commit 8371a5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ fn main() {
println!("[build] Started");

let have_snappy = env::var("CARGO_FEATURE_SNAPPY").is_ok();
let is_bsd = env::var("TARGET").unwrap().ends_with("bsd");
let target = env::var("TARGET").unwrap();
let is_bsd = target.ends_with("bsd");

// If we have the appropriate feature, then we build snappy.
if have_snappy {
Expand Down Expand Up @@ -189,10 +190,9 @@ fn main() {
};
println!("cargo:rustc-flags=-L native={} {}", out_dir, linker_flags);

let target = env::var("TARGET").unwrap();
if target.contains("apple") {
if target.contains("apple") || target.contains("freebsd") {
println!("cargo:rustc-link-lib=c++");
} else if target.contains("gnu") {
} else if target.contains("gnu") || target.contains("netbsd") || target.contains("openbsd") {
println!("cargo:rustc-link-lib=stdc++");
}

Expand Down

0 comments on commit 8371a5c

Please sign in to comment.