File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ smallvec.workspace = true
16
16
[features ]
17
17
nightly = []
18
18
19
- [target .'cfg(all(target_arch = "x86_64", target_os = "linux"))' .dependencies ]
19
+ [target .'cfg(all(target_arch = "x86_64", target_os = "linux", not(target_env = "ohos") ))' .dependencies ]
20
20
memmap2.workspace = true
21
21
perf-event-open-sys.workspace = true
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ const BUG_REPORT_MSG: &str =
303
303
"please report this to https://github.com/rust-lang/measureme/issues/new" ;
304
304
305
305
/// Linux x86_64 implementation based on `perf_event_open` and `rdpmc`.
306
- #[ cfg( all( target_arch = "x86_64" , target_os = "linux" ) ) ]
306
+ #[ cfg( all( target_arch = "x86_64" , target_os = "linux" , not ( target_env = "ohos" ) ) ) ]
307
307
mod hw {
308
308
use memmap2:: { Mmap , MmapOptions } ;
309
309
use perf_event_open_sys:: { bindings:: * , perf_event_open} ;
@@ -935,7 +935,7 @@ mod hw {
935
935
}
936
936
}
937
937
938
- #[ cfg( not( all( target_arch = "x86_64" , target_os = "linux" ) ) ) ]
938
+ #[ cfg( not( all( target_arch = "x86_64" , target_os = "linux" , not ( target_env = "ohos" ) ) ) ) ]
939
939
mod hw {
940
940
use std:: error:: Error ;
941
941
@@ -994,6 +994,10 @@ mod hw {
994
994
add_error ( "only supported OS is Linux" ) ;
995
995
}
996
996
997
+ if cfg ! ( target_env = "ohos" ) {
998
+ add_error ( "unsupported OHOS environment" ) ;
999
+ }
1000
+
997
1001
Err ( msg. into ( ) )
998
1002
}
999
1003
}
You can’t perform that action at this time.
0 commit comments