Expand description
Build script utilities for CMake FFI and cross-compilation.
This crate provides convenience wrappers over Cargo build script environment variables, plus CMake integration for C/C++ FFI bindings.
Re-exports§
Modules§
- bgx
- Build configuration and FFI binding generation for C/C++ projects.
Provides
BindgenConfigfor header parsing and code generation viabindgen. - bin
- Toolchain binary locations (
cargo,rustc,rustdoc). - cargo
- Cargo package environment info: features, manifest, package metadata, and leach-specific build-directory helpers.
- cmkabe
- CMake build integration helpers. Provides CMake configuration, compilation, and installation utilities.
- env
- Inspection and manipulation of the process’s environment.
- fs
- Filesystem manipulation operations.
- io
- Traits, helpers, and type definitions for core I/O functionality.
- metadata
- Inter-dependency metadata communication between build scripts.
- rustc
- Functions for emitting
rustcinstruction metadata back to Cargo. - target
- Target platform information (endianness, pointer width, triple).
Macros§
Structs§
- DirEntry
- A directory entry.
- File
Time - A helper structure to represent a timestamp for a file.
- HashSet
- A hash set implemented as a
HashMapwhere the value is(). - Invalid
Input - Error type indicating a string parse failed due to invalid input.
- Path
- A slice of a path (akin to
str). - PathBuf
- An owned, mutable path (akin to
String). - RefCell
- A mutable memory location with dynamically checked borrow rules
- Regex
- A compiled regular expression for searching Unicode haystacks.
- Regex
Set - Match multiple, possibly overlapping, regexes in a single search.
- Triple
- Platform triple (e.g.
x86_64-unknown-linux-gnu). - WalkDir
- A builder to create an iterator for recursively walking a directory.
Enums§
- Atomic
- Represents an atomic type supported by a target.
- Endianness
- Represents the target platform’s endianness.
- LibKind
- Library linkage kind.
- Profile
- A build profile.
- Search
Kind - Library search path kind.
Traits§
- BufRead
- A
BufReadis a type ofReader which has an internal buffer, allowing it to perform extra ways of reading. - Write
- A trait for objects which are byte-oriented sinks.
Functions§
- canon_
feature_ name - Converts a name to the canonical environment-variable format: upper-case, with hyphens replaced by underscores.
- debug
- Whether this is a debug build.
- error
- Instructs Cargo to display an error and fail the build.
- host
- Host platform triple.
- is_
primary_ package - Whether the current package is the primary target being compiled.
- num_
jobs - Number of top-level parallel jobs.
- opt_
level - Optimisation level (e.g.
0,1,2,3,s,z). - out_dir
- Output directory for build script artifacts (
OUT_DIR). - profile
- Build profile (
DebugorRelease). - realpath
- Resolves a path to its canonical (real) form if it exists,
stripping the
\\?\prefix on Windows. Returns the original path if canonicalization fails. - rerun_
if_ changed - Instructs Cargo to rerun the build script if the given file/directory changes.
- rerun_
if_ env_ changed - Instructs Cargo to rerun the build script if the given environment variable changes.
- target_
tmpdir - Temporary directory for the current build target (
CARGO_TARGET_TMPDIR). - touch
- Updates the timestamps of the specified files.
- unix
- Whether the target platform is UNIX.
- warning
- Instructs Cargo to display a warning message.
- watch_
file_ changes - Watch file changes in the specified directory and triggers rebuilds when matching files change.
- windows
- Whether the target platform is Windows.