Skip to content

Commit 88ede87

Browse files
authored
chore: Don't compile puffin when profiling is off (#408)
1 parent 3eadc5b commit 88ede87

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

neothesia/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ default-run = "neothesia"
88
[features]
99
default = ["oxi-synth"]
1010

11-
profiling-on = ["profiling/profile-with-puffin"]
11+
profiling-on = ["profiling/profile-with-puffin", "puffin", "puffin_http"]
1212
synth = []
1313
fluid-synth = ["synth", "cpal", "fluidlite", "oxisynth"]
1414
oxi-synth = ["synth", "cpal", "oxisynth"]
@@ -38,8 +38,8 @@ fluidlite = { workspace = true, optional = true }
3838
oxisynth = { workspace = true, optional = true }
3939

4040
profiling.workspace = true
41-
puffin.workspace = true
42-
puffin_http.workspace = true
41+
puffin = { workspace = true, optional = true }
42+
puffin_http = { workspace = true, optional = true }
4343
piano-layout.workspace = true
4444

4545
[[bin]]

neothesia/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ fn main() {
373373
)
374374
.init();
375375

376+
#[cfg(feature = "profiling-on")]
376377
puffin::set_scopes_on(true); // tell puffin to collect data
378+
#[cfg(feature = "profiling-on")]
377379
let _server = puffin_http::Server::new("127.0.0.1:8585").ok();
378380

379381
let event_loop: EventLoop<NeothesiaEvent> = EventLoop::with_user_event().build().unwrap();

0 commit comments

Comments
 (0)