Skip to content

Commit

Permalink
Find library names with auto-converted dash to underscore (#294)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Frank <[email protected]>
Co-authored-by: morenol <[email protected]>
  • Loading branch information
3 people authored Jun 5, 2024
1 parent 9b19339 commit cb2b653
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nj-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ fn find_cdylib(package: &Package) -> Option<&Target> {
package
.targets
.iter()
.find(|&target| target.name == package.name)
.find(|&target| target.name == package.name.replace('-', "_"))
.or_else(|| {
package
.targets
.iter()
.find(|&target| target.name == package.name)
})
}

fn find_current_package<'a>(metadata: &'a Metadata, manifest_path: &Path) -> Option<&'a Package> {
Expand Down

0 comments on commit cb2b653

Please sign in to comment.