[package]
name = "ccx_rust"
version = "0.1.0"
authors = ["PunitLodha <punitlodha@pm.me>"]
description = "Rust library for CCExtractor"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

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

[dependencies]
log = "0.4.26"
env_logger = "0.8.4"
palette = "0.7"
tesseract-sys = { version = "0.5.15", optional = true, default-features = false }
leptonica-sys = { version = "= 0.4.6", optional = true, default-features = false }
clap = { version = "4.5.31", features = ["derive"] }
strum_macros = "0.25.3"
time = "0.3.39"
cfg-if = "1.0.0"
num-integer = "0.1.46"
lib_ccxr = { path = "lib_ccxr" }
url = "2.5.4"
serial_test = "3.2.0"
encoding_rs = "0.8.35"

# Use CCExtractor's forked rsmpeg with FFmpeg 7
# All platforms use ffmpeg7 feature with prebuilt bindings for API consistency
[target.'cfg(target_os = "linux")'.dependencies]
rsmpeg = { git = "https://github.com/CCExtractor/rsmpeg.git", default-features = false, features = ["ffmpeg7", "link_system_ffmpeg", "use_prebuilt_binding"], optional = true }

[target.'cfg(target_os = "windows")'.dependencies]
rsmpeg = { git = "https://github.com/CCExtractor/rsmpeg.git", default-features = false, features = ["ffmpeg7", "link_vcpkg_ffmpeg"], optional = true }

# macOS and other platforms use FFmpeg 7
[target.'cfg(not(any(target_os = "linux", target_os = "windows")))'.dependencies]
rsmpeg = { git = "https://github.com/CCExtractor/rsmpeg.git", default-features = false, features = ["ffmpeg7", "link_system_ffmpeg"], optional = true }

[build-dependencies]
bindgen = "0.72.1"
pkg-config = "0.3.32"

[dev-dependencies]
tempfile = "3.20.0"


[features]
wtv_debug = []
enable_ffmpeg = []
with_libcurl = []

# hardsubx_ocr enables OCR and the platform-appropriate rsmpeg
hardsubx_ocr = ["rsmpeg", "tesseract-sys", "leptonica-sys"]
sanity_check = []

[profile.release-with-debug]
inherits = "release"
debug = true
