Skip to content

Commit

Permalink
fix: run install target during build (#273)
Browse files Browse the repository at this point in the history
* fix: run install target during build

Signed-off-by: James Mayclin <[email protected]>

* try ci fix

I think it's no longer necessary to append the "Release" path? But
that's more of a guess

Signed-off-by: James Mayclin <[email protected]>

* cargo fmt

Signed-off-by: James Mayclin <[email protected]>

---------

Signed-off-by: James Mayclin <[email protected]>
  • Loading branch information
jmayclin authored Jan 2, 2025
1 parent 6ecb2cb commit c2e98dc
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions oqs-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,21 @@ 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();

// 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 put into $outdir/build/lib
let mut libdir = outdir.join("build").join("lib");
// lib is installed to $outdir/lib
let libdir = outdir.join("lib");
if cfg!(windows) {
libdir.push("Release");
// Static linking doesn't work on Windows
println!("cargo:rustc-link-lib=oqs");
} else {
Expand All @@ -132,7 +141,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 c2e98dc

Please sign in to comment.