Skip to content

Commit 11bffb8

Browse files
committed
Enhancement for release version: remove fps counter and console on windows
1 parent 303b79a commit 11bffb8

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
with:
4949
use-cross: true
5050
command: build
51-
args: --verbose --release --target ${{ matrix.target }}
51+
args: --verbose --release --target ${{ matrix.target }} --features dist
5252

5353
- name: Build archive
5454
shell: bash

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ wasm-bindgen-futures = "0.4"
3939
web-sys = { version = "0.3.70", features = ["console"], default-features = false }
4040

4141
[profile.release]
42-
opt-level = 2
42+
opt-level = 2
43+
44+
[features]
45+
dist = []

src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg_attr(all(target_os = "windows", feature = "dist"), windows_subsystem = "windows")]
2+
13
extern crate core;
24

35
mod array_table;
@@ -483,6 +485,7 @@ impl<'array> eframe::App for MyApp<'array> {
483485
if self.unsaved_changes { " *" } else { "" }
484486
);
485487

488+
#[cfg(not(feature = "dist"))]
486489
if self.show_fps {
487490
self.frame_history
488491
.on_new_frame(ctx.input(|i| i.time), frame.info().cpu_usage);

0 commit comments

Comments
 (0)