File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,15 @@ extern crate gcc;
2
2
3
3
fn main ( ) {
4
4
if let Ok ( custom) = :: std:: env:: var ( "CUSTOM_LIBFUZZER_PATH" ) {
5
- let custom_lib_dir = :: std:: path:: PathBuf :: from ( & custom) ;
6
- let custom_lib_dir = custom_lib_dir . parent ( ) . unwrap ( ) . to_string_lossy ( ) ;
5
+ let custom_lib_path = :: std:: path:: PathBuf :: from ( & custom) ;
6
+ let custom_lib_dir = custom_lib_path . parent ( ) . unwrap ( ) . to_string_lossy ( ) ;
7
7
8
- let custom_lib_name = :: std:: path:: PathBuf :: from ( & custom) ;
9
- let custom_lib_name = custom_lib_name. file_stem ( ) . unwrap ( ) . to_string_lossy ( ) ;
10
- let custom_lib_name = & custom_lib_name[ 3 ..] ;
8
+ let custom_lib_name = custom_lib_path. file_stem ( ) . unwrap ( ) . to_string_lossy ( ) ;
9
+ let custom_lib_name = custom_lib_name. trim_left_matches ( "lib" ) ;
11
10
12
11
println ! ( "cargo:rustc-link-search=native={}" , custom_lib_dir) ;
13
12
println ! ( "cargo:rustc-link-lib=static={}" , custom_lib_name) ;
13
+ /* FIXME: this is assuming a C++ fuzzer, but should be customizable */
14
14
println ! ( "cargo:rustc-link-lib=stdc++" ) ;
15
15
} else {
16
16
let mut config = gcc:: Config :: new ( ) ;
You can’t perform that action at this time.
0 commit comments