[package]
name = "diffsol-c"
version = "0.3.0"
edition.workspace = true
description = "A diffsol wrapper featuring runtime scalar/matrix/solver types and a C API"
license.workspace = true
authors.workspace = true
repository.workspace = true
readme = "../README.md"

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

[features]
default = ["diffsl-external-dynamic"]
wasm = ["getrandom/js"]
external = []
external-dynamic = []
diffsl-external-f64 = ["external", "diffsol/diffsl-external-f64", "diffsl/external_f64"]
diffsl-external-f32 = ["external", "diffsol/diffsl-external-f32", "diffsl/external_f32"]
diffsl-external-dynamic = ["external-dynamic", "diffsol/diffsl-external-dynamic"]
diffsl-cranelift = ["diffsol/diffsl-cranelift"]
diffsl-llvm = []
diffsl-llvm15 = ["diffsol/diffsl-llvm15", "diffsl-llvm"]
diffsl-llvm16 = ["diffsol/diffsl-llvm16", "diffsl-llvm"]
diffsl-llvm17 = ["diffsol/diffsl-llvm17", "diffsl-llvm"]
diffsl-llvm18 = ["diffsol/diffsl-llvm18", "diffsl-llvm"]
diffsl-llvm19 = ["diffsol/diffsl-llvm19", "diffsl-llvm"]
diffsl-llvm20 = ["diffsol/diffsl-llvm20", "diffsl-llvm"]
diffsl-llvm21 = ["diffsol/diffsl-llvm21", "diffsl-llvm"]
suitesparse = ["diffsol/suitesparse"]

[dependencies]
diffsl = { workspace = true }
diffsol = { path = "../diffsol", version = "0.12.2", features = ["diffsl"] }
dlmalloc = { version = "0.2", features = ["global"] }
nalgebra = { workspace = true, features = ["std"] }
ndarray = { version = "0.17.2" }
num-traits = { workspace = true }
schemars = "1.1.0"
serde = { workspace = true }
serde_json = { workspace = true }
paste = { workspace = true }


[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
faer = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
getrandom = { version = "0.2", optional = true }
faer = { workspace = true, features = [ "rayon" ] } 
