Expand description
Configuration used by PyO3 for conditional support of varying Python versions.
This crate exposes functionality to be called from build scripts to simplify building crates which depend on PyO3.
It used internally by the PyO3 crateβs build script to apply the same configuration.
Re-exportsΒ§
pub use impl_::cross_compiling_from_to;
pub use impl_::find_all_sysconfigdata;
pub use impl_::parse_sysconfigdata;
pub use impl_::BuildFlag;
pub use impl_::BuildFlags;
pub use impl_::CrossCompileConfig;
pub use impl_::InterpreterConfig;
pub use impl_::PythonImplementation;
pub use impl_::PythonVersion;
ModulesΒ§
- errors π
- impl_ π
- Main implementation module included in both the
pyo3-build-config
library crate and its build script. - pyo3_
build_ π»script_ impl - Private exports used in PyO3βs build.rs
MacrosΒ§
- bail π»
- A simple macro for returning an error. Resembles anyhow::bail.
- ensure π»
- A simple macro for checking a condition. Resembles anyhow::ensure.
- format_
warn π» - Format warning into string.
- warn π»
- Show warning.
StructsΒ§
- Triple
- An LLVM target βtripleβ. Historically such things had three fields, though theyβve added additional fields over time.
ConstantsΒ§
- CONFIG_
FILE ππ» - Build configuration provided by
PYO3_CONFIG_FILE
. May be empty if env var not set. - HOST_
CONFIG ππ» - Build configuration discovered by
pyo3-build-config
build script. Not aware of cross-compilation settings.
FunctionsΒ§
- _add_
extension_ πmodule_ link_ args - _add_
python_ πframework_ link_ args - add_
extension_ module_ link_ args - Adds linker arguments suitable for PyO3βs
extension-module
feature. - add_
python_ framework_ link_ args - Adds linker arguments suitable for linking against the Python framework on macOS.
- get
- Loads the configuration determined from the build environment.
- print_
expected_ π»cfgs - Registers
pyo3
s config names as reachable cfg expressions - print_
feature_ πcfg - Helper to print a feature cfg with a minimum rust version required.
- print_
feature_ π»cfgs - Use certain features if we detect the compiler being used supports them.
- resolve_
cross_ ππ»compile_ config_ path - Returns the path where PyO3βs build.rs writes its cross compile configuration.
- rustc_
minor_ πversion - use_
pyo3_ cfgs - Adds all the
#[cfg]
flags to the current compilation.