[package]
name = "framework_lib"
version = "0.4.3"
description = "Library to control Framework Computer systems"
homepage = "https://github.com/FrameworkComputer/framework-system"
repository = "https://github.com/FrameworkComputer/framework-system"
readme = "README.md"
license = "BSD-3-Clause"
edition = "2021"
# Minimum Supported Rust Version
# Ubuntu 24.04 LTS ships 1.75
rust-version = "1.74"
build = "build.rs"

[features]
default = ["hidapi", "rusb"]
rusb = ["dep:rusb"]
hidapi = ["dep:hidapi"]
uefi = [ "lazy_static/spin_no_std" ]

[build-dependencies]
built = { version = "0.5", features = ["chrono", "git2"] }

[dependencies]
lazy_static = "1.4.0"
sha2 = { version = "0.10.8", default-features = false, features = [ "force-soft" ] }
regex = { version = "1.11.1", default-features = false }
num = { version = "0.4", default-features = false }
num-derive = { version = "0.4", default-features = false }
num-traits = { version = "0.2", default-features = false }
log = { version = "0.4", default-features = true }
spin = { version = "0.9.8" }
no-std-compat = { version = "0.4.1", features = [ "alloc" ] }
hidapi = { version = "2.6.3", features = [ "windows-native" ], optional = true }
rusb = { version = "0.9.4", optional = true }
guid-create = { git = "https://github.com/FrameworkComputer/guid-create", branch = "no-rand", default-features = false }

[target.'cfg(target_os = "uefi")'.dependencies]
uefi = { version = "0.20", features = ["alloc"] }
uefi-services = "0.17"
plain = "0.2.3"
redox_hwio = { git = "https://github.com/FrameworkComputer/rust-hwio", branch = "freebsd", default-features = false }
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std", default-features = false }

[target.'cfg(windows)'.dependencies]
wmi = "0.15.0"
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std" }
env_logger = "0.11"
clap = { version = "4.5", features = ["derive", "cargo"] }
clap-num = { version = "1.2.0" }
clap-verbosity-flag = { version = "2.2.1" }

[target.'cfg(unix)'.dependencies]
libc = "0.2.155"
nix = { version = "0.29.0", features = ["ioctl", "user"] }
redox_hwio = { git = "https://github.com/FrameworkComputer/rust-hwio", branch = "freebsd" }
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std" }
env_logger = "0.11"
clap = { version = "4.5", features = ["derive", "cargo"] }
clap-num = { version = "1.2.0" }
clap-verbosity-flag = { version = "2.2.1" }

[target.'cfg(windows)'.dependencies.windows]
version = "0.59.0"
features = [
    "Win32_Foundation",
    "Win32_Storage_FileSystem",
    "Win32_Security",
    "Win32_System_IO",
    "Win32_System_Ioctl",
    "Win32_System_SystemServices",
    # For HID devices
    "Win32_Devices_DeviceAndDriverInstallation",
    "Win32_Devices_HumanInterfaceDevice",
    "Win32_Devices_Properties",
    "Win32_Storage_EnhancedStorage",
    "Win32_System_Threading",
    "Win32_UI_Shell_PropertiesSystem"
]

