@@ -8,6 +8,7 @@ use bevy_app::prelude::*;
8
8
/// * windows,
9
9
/// * android,
10
10
/// * macos
11
+ /// * freebsd
11
12
///
12
13
/// NOT supported when using the `bevy/dynamic` feature even when using previously mentioned targets
13
14
#[ derive( Default ) ]
@@ -27,15 +28,7 @@ impl SystemInformationDiagnosticsPlugin {
27
28
}
28
29
29
30
// NOTE: sysinfo fails to compile when using bevy dynamic or on iOS and does nothing on wasm
30
- #[ cfg( all(
31
- any(
32
- target_os = "linux" ,
33
- target_os = "windows" ,
34
- target_os = "android" ,
35
- target_os = "macos"
36
- ) ,
37
- not( feature = "dynamic_linking" )
38
- ) ) ]
31
+ #[ cfg( all( not( target_os = "ios" ) , not( feature = "dynamic_linking" ) ) ) ]
39
32
pub mod internal {
40
33
use bevy_ecs:: { prelude:: ResMut , system:: Local } ;
41
34
use bevy_log:: info;
@@ -46,6 +39,10 @@ pub mod internal {
46
39
const BYTES_TO_GIB : f64 = 1.0 / 1024.0 / 1024.0 / 1024.0 ;
47
40
48
41
pub ( crate ) fn setup_system ( mut diagnostics : ResMut < DiagnosticsStore > ) {
42
+ if !System :: IS_SUPPORTED {
43
+ bevy_log:: warn!( "This platform and/or configuration is not supported!" ) ;
44
+ return ;
45
+ }
49
46
diagnostics. add (
50
47
Diagnostic :: new (
51
48
super :: SystemInformationDiagnosticsPlugin :: CPU_USAGE ,
@@ -68,6 +65,9 @@ pub mod internal {
68
65
mut diagnostics : Diagnostics ,
69
66
mut sysinfo : Local < Option < System > > ,
70
67
) {
68
+ if !System :: IS_SUPPORTED {
69
+ return ;
70
+ }
71
71
if sysinfo. is_none ( ) {
72
72
* sysinfo = Some ( System :: new_with_specifics (
73
73
RefreshKind :: new ( )
@@ -107,6 +107,9 @@ pub mod internal {
107
107
}
108
108
109
109
pub ( crate ) fn log_system_info ( ) {
110
+ if !System :: IS_SUPPORTED {
111
+ return ;
112
+ }
110
113
let mut sys = sysinfo:: System :: new ( ) ;
111
114
sys. refresh_cpu ( ) ;
112
115
sys. refresh_memory ( ) ;
@@ -131,15 +134,7 @@ pub mod internal {
131
134
}
132
135
}
133
136
134
- #[ cfg( not( all(
135
- any(
136
- target_os = "linux" ,
137
- target_os = "windows" ,
138
- target_os = "android" ,
139
- target_os = "macos"
140
- ) ,
141
- not( feature = "dynamic_linking" )
142
- ) ) ) ]
137
+ #[ cfg( any( target_os = "ios" , feature = "dynamic_linking" ) ) ]
143
138
pub mod internal {
144
139
pub ( crate ) fn setup_system ( ) {
145
140
bevy_log:: warn!( "This platform and/or configuration is not supported!" ) ;
0 commit comments