[package]
name = "origin"
version = "0.8.5"
authors = [
    "Dan Gohman <dev@sunfishcode.online>",
]
description = "Program startup and thread support written in Rust"
documentation = "https://docs.rs/origin"
license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
repository = "https://github.com/sunfishcode/mustang"
edition = "2021"

[dependencies]
linux-raw-sys = { version = "0.3.0", default-features = false, features = ["general", "no_std"] }
rustix = { version = "0.37.12", default-features = false, features = ["mm", "thread", "time", "runtime", "param", "process"] }
bitflags = "1.3.0"
memoffset = { version = "0.8.0", optional = true }
log = { version = "0.4.14", default-features = false, optional = true }
lock_api = { version = "0.4.7", features = ["nightly"] }

# Optional logging backend. You can use any external logger, but using this
# feature allows origin to initialize the logger before main, so that you can
# see the log messages emitted before main is called.
env_logger = { version = "0.10.0", optional = true }

[target.'cfg(not(target_vendor = "mustang"))'.dependencies]
libc = { version = "0.2.138", default-features = false }

# Special dependencies used in rustc-dep-of-std mode.
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }
compiler_builtins = { version = '0.1.49', optional = true }

[features]
default = ["std", "threads", "log"]
std = ["rustix/std", "linux-raw-sys/std"]
set_thread_id = []
rustc-dep-of-std = [
    "core",
    "alloc",
    "compiler_builtins",
    "linux-raw-sys/rustc-dep-of-std",
    "bitflags/rustc-dep-of-std",
    "libc/rustc-dep-of-std",
]

# Support for threads.
threads = ["memoffset"]

# Disable logging.
max_level_off = ["log/max_level_off"]
