[package]
name = "cu29-runtime"
description = "Copper Runtime Runtime crate. Copper is an engine for robotics."
documentation = "https://docs.rs/cu29"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
homepage.workspace = true
repository.workspace = true


[[bin]]
name = "cu29-rendercfg"
path = "src/rendercfg.rs"
required-features = ["std"]

[dependencies]
cu29-clock = { workspace = true }
cu29-log = { workspace = true }
cu29-log-derive = { workspace = true }
cu29-log-runtime = { workspace = true }            # needed
cu29-traits = { workspace = true }
cu29-units = { workspace = true, optional = true }
cu29-unifiedlog = { workspace = true }
cu29-value = { workspace = true }

bincode = { workspace = true }
compact_str = { workspace = true }
erased-serde = { workspace = true }
serde_derive = { workspace = true }
serde = { workspace = true }
smallvec = { workspace = true }
arrayvec = { workspace = true, default-features = false, features = ["serde"] }
html-escape = { version = "0.2", default-features = false }
petgraph = { workspace = true, default-features = false, features = [
  "serde",
  "serde-1",
  "serde_derive",
  "stable_graph",
] }
ron = { version = "0.12", default-features = false }
hashbrown = { workspace = true }
paste = { workspace = true }
portable-atomic = { version = "1.11", default-features = false, features = [
  "fallback",
] }
bevy_reflect = { workspace = true, optional = true }
cu29-reflect-derive = { workspace = true }
layout = { package = "layout-rs", version = "0.1.3", optional = true }
svg = { version = "0.18", optional = true }
serde_json = { version = "1.0", default-features = false, features = [
  "std",
], optional = true }
zenoh = { workspace = true, default-features = false, features = [
  "shared-memory",
  "transport_tcp",
  "transport_unixsock-stream",
], optional = true }
minicbor-serde = { workspace = true, default-features = false, features = [
  "alloc",
], optional = true }

# std only dependencies
clap = { workspace = true, optional = true }       # CLI
rayon = { workspace = true, optional = true }      # Used for async tasks
tempfile = { workspace = true, optional = true }   # only used in CLI for svg generation
object-pool = { version = "0.6", optional = true } # used for large object pooling, this will never happen in no-std
rtrb = { version = "0.3.3", optional = true }
memmap2 = { version = "0.9", optional = true }

# no std only dependencies
spin = { workspace = true }                          # should be removed when std is on, but cargo is bad at negative features
libm = { version = "0.2", default-features = false } # f64 math for 32 bit platforms

[target.'cfg(not(target_os = "macos"))'.dependencies]
cudarc = { version = "0.19", optional = true, default-features = false, features = [
  "std",
  "driver",
  "dynamic-linking",
  "cuda-version-from-build-system",
] }

[features]
default = ["std"]
defmt = ["cu29-log/defmt", "cu29-log-derive/defmt", "cu29-traits/defmt"]
cuda = ["dep:cudarc"]
macro_debug = []
reflect = ["dep:bevy_reflect", "cu29-traits/reflect"]
sysclock-perf = ["std"]
high-precision-limiter = ["std"]
async-cl-io = ["std"]
parallel-rt = ["std", "dep:rtrb"]
mmap-fsync = ["std", "cu29-unifiedlog/mmap-fsync"]
remote-debug = [
  "std",
  "reflect",
  "dep:cu29-units",
  "dep:serde_json",
  "dep:zenoh",
  "dep:minicbor-serde",
  "cu29-units/reflect",
]
std = [
  "dep:clap",
  "dep:rayon",
  "dep:tempfile",
  "dep:object-pool",
  "dep:memmap2",
  "dep:layout",
  "dep:svg",
  "dep:serde_json",
  "ron/std",
  "portable-atomic/std",
  "portable-atomic/require-cas",
  "cu29-clock/std",
  "cu29-log/std",
  "cu29-log-runtime/std",
  "cu29-traits/std",
  "cu29-unifiedlog/std",
  "cu29-value/std",
  "petgraph/std",
]
memory_monitoring = []
bridge-sim-callbacks = []
