Skip to content

Commit

Permalink
Merge pull request #7 from noir-lang/phated/bbwrapper-fixes
Browse files Browse the repository at this point in the history
fix(wrapper): Set up CC & CXX in cargo build file
  • Loading branch information
kobyhallx authored Feb 3, 2023
2 parents a72d6a3 + 505476d commit 75b9e08
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions barretenberg_wrapper/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ fn select_cpp_stdlib() -> &'static str {
OS::Apple => "c++",
}
}
fn set_brew_env_var(toolchain: &'static str) {
// The cmake file for macos uses an environment variable
// to figure out where to find certain programs installed via brew
fn set_compiler(toolchain: &'static str) {
if toolchain == INTEL_APPLE || toolchain == ARM_APPLE {
env::set_var("BREW_PREFIX", find_brew_prefix());
env::set_var("CC", format!("{}/opt/llvm/bin/clang", find_brew_prefix()));
env::set_var(
"CXX",
format!("{}/opt/llvm/bin/clang++", find_brew_prefix()),
);
}
}

Expand Down Expand Up @@ -90,7 +92,7 @@ fn main() {
// TODO: We could check move this to a bash script along with
// TODO: checks that check that all the necessary dependencies are
// TODO installed via llvm
set_brew_env_var(toolchain);
set_compiler(toolchain);

let dst = cmake::Config::new("../barretenberg")
.very_verbose(true)
Expand Down

0 comments on commit 75b9e08

Please sign in to comment.