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;
22
33fn main ( ) {
44 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 ( ) ;
77
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" ) ;
1110
1211 println ! ( "cargo:rustc-link-search=native={}" , custom_lib_dir) ;
1312 println ! ( "cargo:rustc-link-lib=static={}" , custom_lib_name) ;
13+ /* FIXME: this is assuming a C++ fuzzer, but should be customizable */
1414 println ! ( "cargo:rustc-link-lib=stdc++" ) ;
1515 } else {
1616 let mut config = gcc:: Config :: new ( ) ;
You can’t perform that action at this time.
0 commit comments