Skip to content

Commit

Permalink
Explicitly build the rlib
Browse files Browse the repository at this point in the history
Fixes #138.
  • Loading branch information
lu-zero committed Nov 23, 2020
1 parent 59f9fd1 commit 596c582
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions example-project/tests/rust.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use example_project::OddCounter;

#[test]
#[should_panic]
fn test() {
OddCounter::new(40).unwrap();
}
4 changes: 3 additions & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn patch_lib_kind_in_target(ws: &mut Workspace, libkinds: &[&str]) -> anyhow::Re
let manifest = pkg.manifest_mut();
let targets = manifest.targets_mut();

let kinds: Vec<_> = libkinds
let mut kinds: Vec<_> = libkinds
.iter()
.map(|&kind| match kind {
"staticlib" => CrateType::Staticlib,
Expand All @@ -110,6 +110,8 @@ fn patch_lib_kind_in_target(ws: &mut Workspace, libkinds: &[&str]) -> anyhow::Re
})
.collect();

kinds.push(CrateType::Lib);

for target in targets.iter_mut() {
if target.is_lib() {
target.set_kind(TargetKind::Lib(kinds.clone()));
Expand Down

0 comments on commit 596c582

Please sign in to comment.