1[workspace]
2members = [
3    "common/*",
4    "cpu/*",
5    "config/*",
6    "backend/*",
7    "frontend/*",
8]
9default-members = ["frontend/jgenesis-gui"]
10resolver = "3"
11
12[workspace.package]
13version = "0.14.1"
14
15[workspace.dependencies]
16# Third-party dependencies
17anyhow = "1"
18arboard = "3"
19base64 = "0.22"
20bincode = "2"
21bytemuck = { version = "1", features = ["derive"] }
22chd = "0.3"
23clap = { version = "4", features = ["derive"] }
24crc = "3"
25directories = "6"
26egui = "0.34"
27egui_extras = "0.34"
28egui-system-fonts = "0.34"
29egui-wgpu = "0.34"
30emath = "0.34"
31env_logger = "0.11"
32flate2 = "1"
33getrandom = "0.4"
34glyphon = "0.11"
35image = "0.25"
36log = "0.4"
37multiversion = "0.8"
38num = "0.4"
39open = "5"
40pollster = "0.4"
41polonius-the-crab = "0.5"
42rand = "0.10"
43raw-window-handle = "0.6"
44rayon = "1"
45regex = "1"
46rfd = "0.17"
47rustc-hash = "2"
48sdl3 = { version = "0.18", features = ["raw-window-handle"] }
49sdl3-sys = { version = "0.6" }
50serde = { version = "1", features = ["derive"] }
51serde_json = "1"
52sevenz-rust = "0.6"
53smithay-clipboard = "0.7"
54test-log = "0.2"
55thiserror = "2"
56time = "0.3"
57tinyvec = "1"
58toml = "1"
59toml_edit = "0.25"
60wgpu = "29"
61zip = "8"
62zstd = "0.13"
63
64# WASM-only dependencies
65console_error_panic_hook = "0.1"
66console_log = "1"
67js-sys = "0.3"
68wasm-bindgen = "0.2"
69wasm-bindgen-futures = "0.4"
70web-sys = "0.3"
71web-time = "1"
72winit = "0.30"
73
74# Build-only dependencies
75naga = "29"
76
77# Workspace common libraries
78cdrom = { path = "common/cdrom" }
79dsp = { path = "common/dsp" }
80jgenesis-common = { path = "common/jgenesis-common" }
81jgenesis-proc-macros = { path = "common/jgenesis-proc-macros" }
82
83# Workspace CPU libraries
84arm7tdmi-emu = { path = "cpu/arm7tdmi-emu" }
85huc6280-emu = { path = "cpu/huc6280-emu" }
86m68000-emu = { path = "cpu/m68000-emu" }
87mos6502-emu = { path = "cpu/mos6502-emu" }
88sh2-emu = { path = "cpu/sh2-emu" }
89spc700-emu = { path = "cpu/spc700-emu" }
90wdc65816-emu = { path = "cpu/wdc65816-emu" }
91z80-emu = { path = "cpu/z80-emu" }
92
93# Workspace config libraries
94gba-config = { path = "config/gba-config" }
95gb-config = { path = "config/gb-config" }
96genesis-config = { path = "config/genesis-config" }
97nes-config = { path = "config/nes-config" }
98pce-config = { path = "config/pce-config" }
99smsgg-config = { path = "config/smsgg-config" }
100snes-config = { path = "config/snes-config" }
101
102# Workspace backend libraries
103gba-core = { path = "backend/gba-core" }
104gb-core = { path = "backend/gb-core" }
105genesis-components = { path = "backend/genesis-components" }
106genesis-core = { path = "backend/genesis-core" }
107nes-core = { path = "backend/nes-core" }
108pce-core = { path = "backend/pce-core" }
109s32x-core = { path = "backend/s32x-core" }
110segacd-core = { path = "backend/segacd-core" }
111smsgg-core = { path = "backend/smsgg-core" }
112snes-coprocessors = { path = "backend/snes-coprocessors" }
113snes-core = { path = "backend/snes-core" }
114ti-sn76489 = { path = "backend/ti-sn76489" }
115ym-opll = { path = "backend/ym-opll" }
116
117# Workspace frontend libraries
118egui-sdl3-wgpu = { path = "frontend/egui-sdl3-wgpu" }
119jgenesis-debugger-frontend = { path = "frontend/jgenesis-debugger-frontend" }
120jgenesis-native-config = { path = "frontend/jgenesis-native-config" }
121jgenesis-native-driver = { path = "frontend/jgenesis-native-driver" }
122jgenesis-renderer = { path = "frontend/jgenesis-renderer" }
123
124[profile.dev.build-override]
125opt-level = 1
126
127[profile.dev-fast]
128# dev profile with a few adjustments for faster incremental compile times
129inherits = "dev"
130# disable debuginfo
131debug = false
132strip = "debuginfo"
133# set opt-level=1 because most of the emulators are unusably slow without optimizations
134opt-level = 1
135
136[profile.dev-fast.build-override]
137# build proc-macro crates with full optimizations
138opt-level = 3
139
140[profile.release]
141incremental = true
142lto = "thin"
143
144[profile.release.build-override]
145opt-level = 1
146
147[profile.release-lto]
148inherits = "release"
149incremental = false
150lto = true
151codegen-units = 1
152panic = "abort"
153strip = true
154
155[profile.profiling]
156inherits = "release"
157debug = true
158
159[profile.profiling-lto]
160inherits = "profiling"
161lto = true
162
163[workspace.lints.rust]
164rust_2018_idioms = "warn"
165
166[workspace.lints.clippy]
167# Warn broadly on all/pedantic, allowing the broad warns to be overridden
168all = { level = "warn", priority = -1 }
169pedantic = { level = "warn", priority = -1 }
170
171# Warn on a small selection of restriction lints
172clone_on_ref_ptr = "warn"
173dbg_macro = "warn"
174empty_drop = "warn"
175empty_structs_with_brackets = "warn"
176float_cmp_const = "warn"
177fn_to_numeric_cast_any = "warn"
178get_unwrap = "warn"
179if_then_some_else_none = "warn"
180mixed_read_write_in_expression = "warn"
181mod_module_files = "warn"
182mutex_atomic = "warn"
183rc_buffer = "warn"
184rc_mutex = "warn"
185rest_pat_in_fully_bound_structs = "warn"
186suspicious_xor_used_as_pow = "warn"
187todo = "warn"
188try_err = "warn"
189unneeded_field_pattern = "warn"
190unseparated_literal_suffix = "warn"
191verbose_file_reads = "warn"
192
193# Allow pedantic lints that have a high false positive rate or that I disagree with
194cast_possible_truncation = "allow"
195cast_possible_wrap = "allow"
196cast_precision_loss = "allow"
197cast_sign_loss = "allow"
198enum_glob_use = "allow"
199if_not_else = "allow"
200inline_always = "allow"
201manual_string_new = "allow"
202map_unwrap_or = "allow"
203module_name_repetitions = "allow"
204needless_pass_by_value = "allow"
205similar_names = "allow"
206single_match_else = "allow"
207stable_sort_primitive = "allow"
208struct_excessive_bools = "allow"
209struct_field_names = "allow"
210too_many_lines = "allow"
211unchecked_time_subtraction = "allow"
212unreadable_literal = "allow"
213verbose_bit_mask = "allow"