@@ -5,37 +5,24 @@ use std::process::{self, Command};
5
5
6
6
const VERSION : & str = env ! ( "CARGO_PKG_VERSION" ) ;
7
7
8
- #[ cfg( target_family = "windows" ) ]
8
+ #[ cfg( target_family= "windows" ) ]
9
9
compile_error ! ( "honggfuzz-rs does not currently support Windows but works well under WSL (Windows Subsystem for Linux)" ) ;
10
10
11
11
// TODO: maybe use `make-cmd` crate
12
- #[ cfg( not( any(
13
- target_os = "freebsd" ,
14
- target_os = "dragonfly" ,
15
- target_os = "bitrig" ,
16
- target_os = "openbsd" ,
17
- target_os = "netbsd"
18
- ) ) ) ]
12
+ #[ cfg( not( any( target_os = "freebsd" , target_os = "dragonfly" , target_os = "bitrig" , target_os = "openbsd" , target_os = "netbsd" ) ) ) ]
19
13
const GNU_MAKE : & str = "make" ;
20
- #[ cfg( any(
21
- target_os = "freebsd" ,
22
- target_os = "dragonfly" ,
23
- target_os = "bitrig" ,
24
- target_os = "openbsd" ,
25
- target_os = "netbsd"
26
- ) ) ]
14
+ #[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" , target_os = "bitrig" , target_os = "openbsd" , target_os = "netbsd" ) ) ]
27
15
const GNU_MAKE : & str = "gmake" ;
28
16
29
17
fn main ( ) {
30
18
// Only build honggfuzz binaries if we are in the process of building an instrumentized binary
31
19
let honggfuzz_target = match env:: var ( "CARGO_HONGGFUZZ_TARGET_DIR" ) {
32
20
Ok ( path) => path, // path where to place honggfuzz binary. provided by cargo-hfuzz command.
33
- Err ( _) => return ,
21
+ Err ( _) => return
34
22
} ;
35
23
36
24
// check that "cargo hfuzz" command is at the same version as this file
37
- let honggfuzz_build_version =
38
- env:: var ( "CARGO_HONGGFUZZ_BUILD_VERSION" ) . unwrap_or ( "unknown" . to_string ( ) ) ;
25
+ let honggfuzz_build_version = env:: var ( "CARGO_HONGGFUZZ_BUILD_VERSION" ) . unwrap_or ( "unknown" . to_string ( ) ) ;
39
26
if VERSION != honggfuzz_build_version {
40
27
eprintln ! ( "The version of the honggfuzz library dependency ({0}) and the version of the `cargo-hfuzz` executable ({1}) do not match.\n \
41
28
If updating both by running `cargo update` and `cargo install honggfuzz` does not work, you can either:\n \
@@ -65,11 +52,7 @@ fn main() {
65
52
assert ! ( status. success( ) ) ;
66
53
67
54
fs:: copy ( "honggfuzz/libhfuzz/libhfuzz.a" , out_dir. join ( "libhfuzz.a" ) ) . unwrap ( ) ;
68
- fs:: copy (
69
- "honggfuzz/libhfcommon/libhfcommon.a" ,
70
- out_dir. join ( "libhfcommon.a" ) ,
71
- )
72
- . unwrap ( ) ;
55
+ fs:: copy ( "honggfuzz/libhfcommon/libhfcommon.a" , out_dir. join ( "libhfcommon.a" ) ) . unwrap ( ) ;
73
56
fs:: copy ( "honggfuzz/honggfuzz" , honggfuzz_target. join ( "honggfuzz" ) ) . unwrap ( ) ;
74
57
75
58
// tell cargo how to link final executable to hfuzz static library
0 commit comments