Skip to content

Commit

Permalink
fix: run install target during build
Browse files Browse the repository at this point in the history
  • Loading branch information
jmayclin committed Dec 31, 2024
1 parent 6ecb2cb commit d69d682
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions oqs-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,17 @@ fn build_from_source() -> PathBuf {
config.define(permit_unsupported, str);
}

let outdir = config.build_target("oqs").build();
// build the default (install) target.
let outdir = config.build();

// lib is put into $outdir/build/lib
let mut libdir = outdir.join("build").join("lib");
// remove the build folder
let temp_build = outdir.join("build");
if let Err(e) = std::fs::remove_dir_all(temp_build) {
println!("cargo:warning=unexpected error while cleaning build files:{}", e);
}

// lib is installed to $outdir/lib
let mut libdir = outdir.join("lib");
if cfg!(windows) {
libdir.push("Release");
// Static linking doesn't work on Windows
Expand All @@ -132,7 +139,7 @@ fn build_from_source() -> PathBuf {

fn includedir_from_source() -> PathBuf {
let outdir = build_from_source();
outdir.join("build").join("include")
outdir.join("include")
}

fn probe_includedir() -> PathBuf {
Expand Down

0 comments on commit d69d682

Please sign in to comment.