[package]
name = "hypercutter"
version = "0.3.0"
edition = "2021"
rust-version = "1.75"
license = "MIT OR Apache-2.0"
repository = "https://github.com/cuebitt/hypercutter"
homepage = "https://github.com/cuebitt/hypercutter"
documentation = "https://docs.rs/hypercutter"
readme = "README.md"
description = "Extract data from GBA Pokemon ROMs."
keywords = ["pokemon", "gba", "rom", "extraction", "sprites"]
categories = ["game-development", "parser-implementations"]
exclude = ["tests/", "examples/", "pkg/", ".github/"]

[lib]
name = "hypercutter"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "hypercutter"
path = "src/bin/hypercutter.rs"


[dependencies]
thiserror = "1"
anyhow = "1"
binrw = "0.15"
bilge = "0.3"
nintendo_lz = { package = "nintendo-lz", version = "0.1" }
sha2 = "0.10"
serde = { version = "1", features = ["derive"] }
png = "0.17"
log = "0.4"

# Native-only deps (CLI + HTTP downloader). Not pulled into the WASM
# build of the library.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
clap = { version = "4", features = ["derive"] }
ureq = { version = "3", default-features = false, features = ["rustls"] }
dialoguer = "0.11"
indicatif = "0.17"
dirs = "5"
env_logger = "0.11"
console = "0.15"
rayon = "1"
glob = "0.3"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
js-sys = "0.3"
serde-wasm-bindgen = "0.6"

[dev-dependencies]
tempfile = "3"
image = { version = "0.25", default-features = false, features = ["png"] }
walkdir = "2"

[[example]]
name = "compare"
path = "examples/compare.rs"

[[example]]
name = "compare-all"
path = "examples/compare_all.rs"

[profile.release]
lto = "thin"
codegen-units = 1
strip = "symbols"

# WASM-specific overrides: smaller binary, opt-level z.
[profile.release.package."*"]
opt-level = 3

[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-gc", "--enable-bulk-memory", "--enable-reference-types"]

