Skip to content

Commit

Permalink
build: allow CMAKE_BUILD_TYPE override
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelelliot committed Jan 24, 2024
1 parent fb6de0e commit c9eaa62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion noir/tooling/noir_rs/barretenberg/build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
use std::env;
use cmake::Config;

fn main() {
// Notify Cargo to rerun this build script if `build.rs` changes.
println!("cargo:rerun-if-changed=build.rs");

// Retrieve CMAKE_BUILD_TYPE from environment or use default
let cmake_build_type = env::var("CMAKE_BUILD_TYPE").unwrap_or_else(|_| "RelWithAssert".to_string());

// Build the C++ code using CMake and get the build directory path.
let dst = Config::new("../../../../barretenberg/cpp")
.configure_arg("-DCMAKE_BUILD_TYPE=RelWithAssert")
.define("CMAKE_BUILD_TYPE", &cmake_build_type)
.define("TARGET_ARCH", "skylake")
.build();

Expand Down

0 comments on commit c9eaa62

Please sign in to comment.