diff --git a/Changelog.md b/Changelog.md index 5aef77f6f..c3777d3ba 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] * Fix `maturin develop` in Windows conda virtual environment in [#1146](https://github.com/PyO3/maturin/pull/1146) +* Fix build for crate using `pyo3` and `build.rs` without `cdylib` crate type in [#1150](https://github.com/PyO3/maturin/pull/1150) ## [0.13.5] - 2022-09-27 diff --git a/src/build_options.rs b/src/build_options.rs index 7fd5f620d..9a9f1f861 100644 --- a/src/build_options.rs +++ b/src/build_options.rs @@ -861,6 +861,11 @@ pub fn find_bridge(cargo_metadata: &Metadata, bridge: Option<&str>) -> Result
= root_package .targets .iter() + .filter(|target| { + target.kind.iter().any(|kind| { + kind != "example" && kind != "test" && kind != "bench" && kind != "custom-build" + }) + }) .flat_map(|target| target.crate_types.iter()) .map(String::as_str) .collect();