Skip to content

Commit

Permalink
refactor: env conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
chancehudson committed Jul 7, 2024
1 parent 66be909 commit 768dd39
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ include!("./src/transpile.rs");

// We only want to link our test witness functions if we're compiling
// for the tests in rust-witness. Cargo/rust doesn't seem to offer
// a solution so we use a simple env variable in the test command
// a solution so we use a simple env variable set using .cargo
fn main() {
let link_test_witness =
std::env::var("RUST_WITNESS_LINK_TEST_WITNESS").unwrap_or("".to_string());
if link_test_witness != "" {
if let Ok(_) = std::env::var("RUST_WITNESS_LINK_TEST_WITNESS") {
transpile_wasm(String::from("./tests"));
}
}

0 comments on commit 768dd39

Please sign in to comment.