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
1616[features ]
1717nightly = []
1818
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 ]
2020memmap2.workspace = true
2121perf-event-open-sys.workspace = true
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ const BUG_REPORT_MSG: &str =
303303 "please report this to https://github.com/rust-lang/measureme/issues/new" ;
304304
305305/// 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" ) ) ) ]
307307mod hw {
308308 use memmap2:: { Mmap , MmapOptions } ;
309309 use perf_event_open_sys:: { bindings:: * , perf_event_open} ;
@@ -935,7 +935,7 @@ mod hw {
935935 }
936936}
937937
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" ) ) ) ) ]
939939mod hw {
940940 use std:: error:: Error ;
941941
@@ -994,6 +994,10 @@ mod hw {
994994 add_error ( "only supported OS is Linux" ) ;
995995 }
996996
997+ if cfg ! ( target_env = "ohos" ) {
998+ add_error ( "unsupported OHOS environment" ) ;
999+ }
1000+
9971001 Err ( msg. into ( ) )
9981002 }
9991003 }
You can’t perform that action at this time.
0 commit comments