# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

[package]
name = "icu_locale_core"
description = "API for managing Unicode Language and Locale Identifiers"

authors.workspace = true
categories.workspace = true
edition.workspace = true
homepage.workspace = true
include.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[package.metadata.docs.rs]
all-features = true

[dependencies]
displaydoc = { workspace = true }
litemap = { workspace = true, features = ["alloc"] }
tinystr = { workspace = true, features = ["alloc"] }
writeable = { workspace = true }

databake = { workspace = true, features = ["derive"], optional = true }
serde = { workspace = true, features = ["alloc", "derive"], optional = true }
zerovec = { workspace = true, optional = true }

[dev-dependencies]
iai = { workspace = true }
icu = { path = "../../components/icu", default-features = false }
icu_provider = { path = "../../provider/core" }
icu_benchmark_macros = { path = "../../tools/benchmark/macros" }
litemap = { path = "../../utils/litemap", features = ["testing"] }
postcard = { workspace = true, features = ["use-std"] }
potential_utf = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }


[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = { workspace = true }

[features]
std = []
databake = ["dep:databake"]
serde = ["dep:serde", "tinystr/serde"]
zerovec = ["dep:zerovec", "tinystr/zerovec"]
bench = ["serde"]

[lib]
bench = false # This option is required for Benchmark CI

[package.metadata.cargo-all-features]
# Bench feature gets tested separately and is only relevant for CI
denylist = ["bench"]

[[bench]]
name = "subtags"
harness = false
required-features = ["bench"]

[[bench]]
name = "langid"
harness = false

[[bench]]
name = "locale"
harness = false

[[bench]]
name = "iai_langid"
harness = false
required-features = ["bench"]

[[example]]
name = "filter_langids"
test = true

[[example]]
name = "syntatically_canonicalize_locales"
test = true
