[package]
edition = "2021"
name = "crosscopy_clipboard"
version = "0.0.0"

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

[features]
default = ["image"]
image = ["dep:image"]
wayland = ["dep:wl-clipboard-rs"]

[dependencies]
base64 = "0.22.0"
futures = "0.3.30"
# Pin image to version compatible with older Rust in CI Docker images
image = { version = "=0.25.5", features = ["png", "jpeg"], optional = true, default-features = false }
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "3.9.0", default-features = false, features = ["napi4", "tokio_rt", "dyn-symbols"] }
napi-derive = "3.5.6"
tokio = "1.36.0"

[target.'cfg(all(unix, not(any(target_os="macos", target_os="android", target_os="ios", target_os="emscripten"))))'.dependencies]
wl-clipboard-rs = { version = "0.9", optional = true }
x11rb = { version = "0.13.2", features = ["xfixes"] }

[target.'cfg(target_os = "macos")'.dependencies]
image = { version = "=0.25.5", features = ["tiff", "png", "jpeg"], optional = true, default-features = false }
objc2 = "0.6.3"
objc2-app-kit = { version = "0.3.2", features = ["NSPasteboard", "NSPasteboardItem", "NSImage"] }
objc2-foundation = { version = "0.3.2", features = ["NSArray", "NSString", "NSEnumerator"] }

[target.'cfg(target_os = "windows")'.dependencies]
clipboard-win = { version = "5.4.1", features = ["monitor"] }
image = { version = "=0.25.5", features = ["bmp", "png", "jpeg"], optional = true, default-features = false }
windows = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Graphics_Gdi", "Win32_System_DataExchange"] }

[build-dependencies]
# Pin to version that works with older Rust in Docker images
napi-build = "2.3.2"

[profile.release]
lto = true
strip = "symbols"
