Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out unwanted Cargo target kinds when determine bridge model #1150

Merged
merged 1 commit into from Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/build_options.rs
Expand Up @@ -861,6 +861,11 @@ pub fn find_bridge(cargo_metadata: &Metadata, bridge: Option<&str>) -> Result<Br
let targets: Vec<_> = 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();
Expand Down