Skip to content

Commit ce97662

Browse files
authored
Merge pull request #56 from jfoote/master
Add env var to select c++ std lib
2 parents 20e57c5 + cf0ec8a commit ce97662

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

build.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ fn main() {
88

99
println!("cargo:rustc-link-search=native={}", custom_lib_dir);
1010
println!("cargo:rustc-link-lib=static={}", custom_lib_name);
11-
/* FIXME: this is assuming a C++ fuzzer, but should be customizable */
12-
println!("cargo:rustc-link-lib=stdc++");
11+
12+
match std::env::var("CUSTOM_LIBFUZZER_STD_CXX") {
13+
// Default behavior for backwards compat.
14+
Err(_) => println!("cargo:rustc-link-lib=stdc++"),
15+
Ok(s) if s == "none" => (),
16+
Ok(s) => println!("cargo:rustc-link-lib={}", s),
17+
}
1318
} else {
1419
let mut build = cc::Build::new();
1520
let sources = ::std::fs::read_dir("libfuzzer")

0 commit comments

Comments
 (0)