Skip to content

Commit bfef190

Browse files
committed
fixes #5202 -- treat the PYO3_BUILD_EXTENSION_MODULE env var the same as teh extension-module feature
1 parent 12a1792 commit bfef190

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pyo3-build-config/src/impl_.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,14 @@ pub fn get_abi3_version() -> Option<PythonVersion> {
862862

863863
/// Checks if the `extension-module` feature is enabled for the PyO3 crate.
864864
///
865+
/// This can be triggered either by:
866+
/// - The `extension-module` Cargo feature
867+
/// - Setting the `PYO3_BUILD_EXTENSION_MODULE` environment variable
868+
///
865869
/// Must be called from a PyO3 crate build script.
866870
pub fn is_extension_module() -> bool {
867871
cargo_env_var("CARGO_FEATURE_EXTENSION_MODULE").is_some()
872+
|| env_var("PYO3_BUILD_EXTENSION_MODULE").is_some()
868873
}
869874

870875
/// Checks if we need to link to `libpython` for the current build target.

0 commit comments

Comments
 (0)