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 1
1
use std:: { env, path:: PathBuf } ;
2
2
3
3
fn main ( ) {
4
+ if cfg ! ( not( target_os = "linux" ) ) {
5
+ // The instrument-hooks library is only supported on Linux.
6
+ return ;
7
+ }
8
+
4
9
// Compile the C library
5
10
cc:: Build :: new ( )
6
11
. file ( "instrument-hooks/dist/core.c" )
Original file line number Diff line number Diff line change 1
- #[ cfg( unix ) ]
1
+ #[ cfg( target_os = "linux" ) ]
2
2
mod ffi;
3
3
4
- #[ cfg( unix ) ]
5
- mod unix_impl {
4
+ #[ cfg( target_os = "linux" ) ]
5
+ mod linux_impl {
6
6
use nix:: sys:: time:: TimeValLike ;
7
7
8
8
use super :: ffi;
@@ -131,7 +131,7 @@ mod unix_impl {
131
131
}
132
132
}
133
133
134
- #[ cfg( not( unix ) ) ]
134
+ #[ cfg( not( target_os = "linux" ) ) ]
135
135
mod other_impl {
136
136
pub struct InstrumentHooks ;
137
137
@@ -169,10 +169,10 @@ mod other_impl {
169
169
}
170
170
}
171
171
172
- #[ cfg( unix ) ]
173
- pub use unix_impl :: InstrumentHooks ;
172
+ #[ cfg( target_os = "linux" ) ]
173
+ pub use linux_impl :: InstrumentHooks ;
174
174
175
- #[ cfg( not( unix ) ) ]
175
+ #[ cfg( not( target_os = "linux" ) ) ]
176
176
pub use other_impl:: InstrumentHooks ;
177
177
178
178
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments