File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 11use std:: { env, path:: PathBuf } ;
22
33fn main ( ) {
4+ if cfg ! ( not( target_os = "linux" ) ) {
5+ // The instrument-hooks library is only supported on Linux.
6+ return ;
7+ }
8+
49 // Compile the C library
510 cc:: Build :: new ( )
611 . file ( "instrument-hooks/dist/core.c" )
Original file line number Diff line number Diff line change 1- #[ cfg( unix ) ]
1+ #[ cfg( target_os = "linux" ) ]
22mod ffi;
33
4- #[ cfg( unix ) ]
5- mod unix_impl {
4+ #[ cfg( target_os = "linux" ) ]
5+ mod linux_impl {
66 use nix:: sys:: time:: TimeValLike ;
77
88 use super :: ffi;
@@ -131,7 +131,7 @@ mod unix_impl {
131131 }
132132}
133133
134- #[ cfg( not( unix ) ) ]
134+ #[ cfg( not( target_os = "linux" ) ) ]
135135mod other_impl {
136136 pub struct InstrumentHooks ;
137137
@@ -169,10 +169,10 @@ mod other_impl {
169169 }
170170}
171171
172- #[ cfg( unix ) ]
173- pub use unix_impl :: InstrumentHooks ;
172+ #[ cfg( target_os = "linux" ) ]
173+ pub use linux_impl :: InstrumentHooks ;
174174
175- #[ cfg( not( unix ) ) ]
175+ #[ cfg( not( target_os = "linux" ) ) ]
176176pub use other_impl:: InstrumentHooks ;
177177
178178#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments