[package]
name = "julia-set"
version = "0.1.0"
edition = "2018"
authors = ["Alex Ostrovski <ostrovski.alex@gmail.com>"]
readme = "README.md"
license = "Apache-2.0"
keywords = ["julia", "fractal", "graphics", "opencl", "vulkan"]
categories = ["mathematics", "multimedia::images", "rendering"]
description = "Julia set computation and rendering"
repository = "https://github.com/slowli/julia-set-rs"

[package.metadata.docs.rs]
all-features = true
# Set `docsrs` to enable unstable `doc(cfg(...))` attributes.
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
anyhow = "1.0.28"
image = { version = "0.23.12", default-features = false, features = ["png", "jpeg"] }
num-complex = "0.3.1"
thiserror = "1.0.14"

arithmetic-parser = { version = "0.2.0", features = ["num-complex"], optional = true }

# OpenCL backend
ocl = { version = "0.19.3", optional = true }
lazy_static = { version = "1.4.0", optional = true }
# Vulkan backend
shaderc = { version = "0.7.0", optional = true }
vulkano = { version = "0.20.0", optional = true }
# CPU backend
rayon = { version = "1.5.0", optional = true }

[dev-dependencies]
criterion = "0.3.3"
structopt = "0.3.21"
version-sync = "0.9.1"

[features]
# Enables the Vulkan backend (GPU-based).
vulkan_backend = ["arithmetic-parser", "shaderc", "vulkano"]
# Enables the OpenCL backend (GPU-based).
opencl_backend = ["arithmetic-parser", "ocl", "lazy_static"]
# Enables the CPU backend with native functions.
cpu_backend = ["rayon"]
# Enables the CPU backend with support of dynamically defined functions.
dyn_cpu_backend = ["cpu_backend", "arithmetic-parser"]

[[test]]
name = "references"
path = "tests/references.rs"
required-features = ["cpu_backend"]

[[example]]
name = "cli"
path = "examples/cli.rs"
required-features = ["dyn_cpu_backend"]
# TODO: strictly speaking, we need any of 3 "dynamic" backends, but the manifest
# seemingly doesn't allow to express this.

[[bench]]
name = "basics"
harness = false
required-features = ["dyn_cpu_backend"]
path = "benches/basics.rs"

# Speed up snapshot testing.
[profile.dev.package.julia-set]
opt-level = 2
