OpenBSD has two stdc++ libraries: use the newer
stdc++ is from base, and is an old library (GCC 4.2) estdc++ is from ports, and is a recent library (GCC 4.9 currently) as LLVM requires the newer version, use it if under OpenBSD.
This commit is contained in:
parent
a7d9025e40
commit
2c39ee12a9
1 changed files with 9 additions and 2 deletions
|
@ -230,6 +230,13 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OpenBSD has a particular C++ runtime library name
|
||||||
|
let stdcppname = if target.contains("openbsd") {
|
||||||
|
"estdc++"
|
||||||
|
} else {
|
||||||
|
"stdc++"
|
||||||
|
};
|
||||||
|
|
||||||
// C++ runtime library
|
// C++ runtime library
|
||||||
if !target.contains("msvc") {
|
if !target.contains("msvc") {
|
||||||
if let Some(s) = env::var_os("LLVM_STATIC_STDCPP") {
|
if let Some(s) = env::var_os("LLVM_STATIC_STDCPP") {
|
||||||
|
@ -237,11 +244,11 @@ fn main() {
|
||||||
let path = PathBuf::from(s);
|
let path = PathBuf::from(s);
|
||||||
println!("cargo:rustc-link-search=native={}",
|
println!("cargo:rustc-link-search=native={}",
|
||||||
path.parent().unwrap().display());
|
path.parent().unwrap().display());
|
||||||
println!("cargo:rustc-link-lib=static=stdc++");
|
println!("cargo:rustc-link-lib=static={}", stdcppname);
|
||||||
} else if cxxflags.contains("stdlib=libc++") {
|
} else if cxxflags.contains("stdlib=libc++") {
|
||||||
println!("cargo:rustc-link-lib=c++");
|
println!("cargo:rustc-link-lib=c++");
|
||||||
} else {
|
} else {
|
||||||
println!("cargo:rustc-link-lib=stdc++");
|
println!("cargo:rustc-link-lib={}", stdcppname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue