Skip to content

Commit 2d8b69a

Browse files
committed
Use a platform independent metric for detecting libs and proc-macros
1 parent a6949e7 commit 2d8b69a

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/dependencies.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,11 @@ pub(crate) fn build_dependencies(config: &Config) -> Result<Dependencies> {
100100
continue;
101101
};
102102
if let cargo_metadata::Message::CompilerArtifact(artifact) = message {
103-
if artifact
104-
.filenames
105-
.iter()
106-
.any(|f| f.ends_with("build-script-build"))
107-
{
108-
continue;
109-
}
110-
// Check that we only collect rmeta and rlib crates, not build script crates
111-
if artifact.filenames.iter().any(|f| {
112-
!matches!(
113-
f.extension(),
114-
Some("rlib" | "rmeta" | "so" | "dylib" | "dll")
115-
)
116-
}) {
117-
continue;
103+
for ctype in artifact.target.crate_types {
104+
match ctype.as_str() {
105+
"proc-macro" | "lib" => {}
106+
_ => continue,
107+
}
118108
}
119109
for filename in &artifact.filenames {
120110
import_paths.insert(filename.parent().unwrap().into());

0 commit comments

Comments
 (0)