[package]
build = "build.rs"
name = "rstmt"

authors.workspace = true
categories.workspace = true
description.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[package.metadata.docs.rs]
all-features = false
features = ["default"]
rustc-args = ["--cfg", "docsrs"]

[package.metadata.release]
no-dev-version = true
tag-name = "v{{version}}"

[lib]
bench = true
crate-type = ["lib"]
doc = true
doctest = true
path = "lib.rs"
test = true

[[bench]]
harness = false
name = "triad"
required-features = ["nrt", "std"]

[[example]]
name = "motion"
required-features = ["motion", "std", "tonnetz"]

[[example]]
name = "triads"
required-features = ["nrt", "std"]

[dependencies]
rstmt-core = { workspace = true }
rstmt-macros = { optional = true, workspace = true }
rstmt-nrt = { optional = true, workspace = true }

[dev-dependencies]
anyhow = { features = ["std"], workspace = true }
criterion = { features = ["plotters"], workspace = true }
lazy_static = { workspace = true }
tracing = { features = ["attributes", "std"], workspace = true }
tracing-subscriber = { features = ["ansi", "serde", "std"], workspace = true }

[features]
default = [
  "macros",
  "motion",
  "nrt",
  "std",
  "tonnetz",
]

full = [
  "default",
  "complex",
  "json",
  "rand",
  "serde",
]

nightly = [
  "rstmt-core/nightly",
  "rstmt-macros/nightly",
  "rstmt-nrt?/nightly",
]

# ************* [FF:Features] *************
macros = [
  "dep:rstmt-macros",
  "rstmt-core/macros",
]

motion = [
  "rstmt-nrt?/motion",
]

nrt = ["dep:rstmt-nrt"]

tonnetz = [
  "std",
  "hashbrown",
  "motion",
  "nrt",
  "rstmt-nrt?/tonnetz",
]

# ************* [FF:Environments] *************
std = [
  "rstmt-core/std",
  "rstmt-nrt?/std",
]

wasi = [
  "rstmt-core/wasi",
  "rstmt-nrt?/wasi",
]

wasm = [
  "rstmt-core/wasm",
  "rstmt-nrt?/wasm",
]

# ************* [FF:Dependencies] *************
alloc = [
  "rstmt-core/alloc",
  "rstmt-nrt?/alloc",
]

complex = [
  "rstmt-core/complex",
]

hashbrown = [
  "rstmt-core/hashbrown",
  "rstmt-nrt?/hashbrown",
]

json = [
  "alloc",
  "serde",
  "serde_json",
  "rstmt-core/json",
  "rstmt-nrt?/json",
]

rand = [
  "rstmt-core/rand",
  "rstmt-nrt?/rand",
]

rayon = [
  "rstmt-core/rayon",
  "rstmt-nrt?/rayon",
]

rng = [
  "rstmt-core/rng",
  "rstmt-nrt?/rng",
]

serde = [
  "rstmt-core/serde",
  "rstmt-nrt?/serde",
]

serde_json = [
  "rstmt-core/serde_json",
  "rstmt-nrt?/serde_json",
]

wasm_bindgen = [
  "rstmt-core/wasm_bindgen",
  "rstmt-nrt?/wasm_bindgen",
]
