diff --git a/Cargo.toml b/Cargo.toml index 73fee26..227e554 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,26 +17,45 @@ exclude = ["/assets/unpacked/**", "/assets/site/**", "/bacon.toml", "/Justfile"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +bevy_ecs = "0.16.1" +glam = "0.30.5" +pathfinding = "4.14" tracing = { version = "0.1.41", features = ["max_level_debug", "release_max_level_debug"]} tracing-error = "0.2.0" tracing-subscriber = {version = "0.3.20", features = ["env-filter"]} thiserror = "2.0.16" anyhow = "1.0" -bevy_ecs = "0.16.1" -glam = "0.30.5" rand = { version = "0.9.2", default-features = false, features = ["small_rng", "os_rng"] } -pathfinding = "4.14" smallvec = "1.15.1" bitflags = "2.9.4" micromap = "0.1.0" circular-buffer = "1.1.0" parking_lot = "0.12.3" -spin_sleep = "1.3.2" strum = "0.27.2" strum_macros = "0.27.2" -phf = { version = "0.13.1", features = ["macros"] } thousands = "0.2.0" num-width = "0.1.0" +# While not actively used in code, `build.rs` generates code that relies on this. Keep the versions synchronized. +phf = { version = "0.13.1", features = ["macros"] } + +# Windows-specific dependencies +[target.'cfg(target_os = "windows")'.dependencies] +# Used for customizing console output on Windows; both are required due to the `windows` crate having poor Result handling with `GetStdHandle`. +windows = { version = "0.61.3", features = ["Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console"] } +windows-sys = { version = "0.60.2", features = ["Win32_System_Console"] } + +# Desktop-specific dependencies +[target.'cfg(not(target_os = "emscripten"))'.dependencies] +# On desktop platforms, build SDL2 with cargo-vcpkg +sdl2 = { version = "0.38", default-features = false, features = ["image", "ttf", "gfx", "mixer", "unsafe_textures", "static-link", "use-vcpkg"] } +spin_sleep = "1.3.2" + +# Browser-specific dependencies +[target.'cfg(target_os = "emscripten")'.dependencies] +# On Emscripten, we don't use cargo-vcpkg +sdl2 = { version = "0.38", default-features = false, features = ["image", "ttf", "gfx", "mixer", "unsafe_textures"] } +# TODO: Document why Emscripten cannot use `os_rng`. +libc = "0.2.175" # TODO: Describe why this is required. [dev-dependencies] pretty_assertions = "1.4.1" @@ -59,32 +78,16 @@ opt-level = 3 lto = false panic = 'unwind' -# LTO optimizations, no unwinding on panic, optimize for size +# Optimized release profile for size [profile.release] +opt-level = "z" lto = true panic = "abort" -opt-level = "z" - -# Used for customizing console output on Windows; both are required due to the `windows` crate having poor Result handling with `GetStdHandle`. -[target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.61.3", features = ["Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console"] } -windows-sys = { version = "0.60.2", features = ["Win32_System_Console"] } - -# On desktop platforms, build SDL2 with cargo-vcpkg -[target.'cfg(not(target_os = "emscripten"))'.dependencies.sdl2] -version = "0.38" -default-features = false -features = ["image", "ttf", "gfx", "mixer", "unsafe_textures", "static-link", "use-vcpkg"] - -# On Emscripten, we don't use cargo-vcpkg -[target.'cfg(target_os = "emscripten")'.dependencies] -sdl2 = { version = "0.38", default-features = false, features = ["image", "ttf", "gfx", "mixer", "unsafe_textures"] } -libc = "0.2.175" # TODO: Describe why this is required. [package.metadata.vcpkg] dependencies = ["sdl2", "sdl2-image", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"] git = "https://github.com/microsoft/vcpkg" -rev = "2024.05.24" # release 2024.05.24 # to check for a new one, check https://github.com/microsoft/vcpkg/releases +rev = "2024.05.24" # to check for a new one, check https://github.com/microsoft/vcpkg/releases [package.metadata.vcpkg.target] x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" }