| Crates.io | oxdock-buildtime-helpers |
| lib.rs | oxdock-buildtime-helpers |
| version | 0.6.0-alpha |
| created_at | 2025-12-20 16:22:08.164113+00 |
| updated_at | 2025-12-25 17:46:10.819895+00 |
| description | Build script helpers for OxDock. |
| homepage | |
| repository | https://github.com/jzombie/oxdock-rs |
| max_upload_size | |
| id | 1996677 |
| size | 13,997 |
Build-script helpers for forwarding Cargo feature/cfg information to OxDock's proc-macro execution environment.
This crate is intended to be called from a
build.rsbuild script. It is not meant to run at application runtime.
Proc-macro processes do not receive CARGO_FEATURE_* or CARGO_CFG_* by default.
Build scripts do. These helpers re-emit those values as cargo:rustc-env=... so proc-macros
can read them and pass them into the OxDock environment (via BuiltinEnv).
fn main() {
oxdock_buildtime_helpers::emit_feature_and_cfg_envs()
.expect("failed to emit feature/cfg envs");
}
emit_feature_envs(): forward CARGO_FEATURE_* and CARGO_CFG_FEATUREemit_cfg_envs(): forward CARGO_CFG_* derived from rustc --print cfgemit_feature_and_cfg_envs(): calls both| Item | Helper Necessary? |
|---|---|
FOO=1 cargo build |
No |
CLI args sent to cargo run -- ... |
TBD |
| Available cargo features / cfgs | Yes |
| All other environment variables | No |
Licensed under the Apache-2.0 License.