Skip to content

Commit

Permalink
feat: get so path
Browse files Browse the repository at this point in the history
  • Loading branch information
chesedo authored Feb 25, 2022
1 parent a3a362f commit 02b911a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ fn build_crate(project_path: &Path) -> Result<PathBuf> {

let ws = Workspace::new(&manifest_path, &config)?;
let opts = CompileOptions::new(&config, CompileMode::Build)?;
let _compilation = cargo::ops::compile(&ws, &opts)?;
let compilation = cargo::ops::compile(&ws, &opts)?;

Err(anyhow!("next step is to figure out how to get the .so file from the compilation output"))
if compilation.cdylibs.is_empty() {
return Err(anyhow!("a cdylib was not created"));
}

Ok(compilation.cdylibs[0].path.clone())
}

0 comments on commit 02b911a

Please sign in to comment.