[package]
name = "ctor"
version = "1.0.2"
authors.workspace = true
edition = "2021"
description = "Global, no_std-compatible constructors for all platforms that run before main (like C/C++ __attribute__((constructor)))"
license.workspace = true
repository.workspace = true
readme = "README.md"
categories = ["development-tools::build-utils", "no-std", "no-std::no-alloc", "embedded", "development-tools::procedural-macro-helpers"]
rust-version = "1.60"

exclude = ["tests"]

[features]
default = ["std", "proc_macro", "priority"]

std = []

# Enable support for the priority parameter
priority = ["dep:link-section"]

# Enable the proc_macro
proc_macro = ["dep:linktime-proc-macro"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
    'cfg(linktime_no_fail_on_missing_unsafe)',
    'cfg(linktime_used_linker)'
] }

[dependencies]
linktime-proc-macro = { workspace = true, optional = true, features = ["ctor"] }
link-section = { workspace = true, optional = true, default-features = false }

[dev-dependencies]
libc-print = "0.3"
macrotest = "1"
trybuild = "1"
walkdir = "2"
tempfile = "3"
