Skip to content

Commit

Permalink
fix(rust): define NDEBUG when debug assertions are off (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jul 3, 2024
1 parent 69616da commit 1bccee0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ fn main() {
cc.include(blst_headers_dir.clone());
cc.warnings(false);
cc.file(c_src_dir.join("c_kzg_4844.c"));
#[cfg(not(debug_assertions))]
cc.define("NDEBUG", None);

cc.try_compile("ckzg").expect("Failed to compile ckzg");

#[cfg(feature = "generate-bindings")]
{
let header_path = c_src_dir.join("c_kzg_4844.h");
let bindings_out_path = concat!(
env!("CARGO_MANIFEST_DIR"),
"/bindings/rust/src/bindings/generated.rs"
);
let bindings_out_path = root_dir.join("bindings/rust/src/bindings/generated.rs");
make_bindings(
header_path.to_str().expect("valid header path"),
blst_headers_dir.to_str().expect("valid blst header path"),
bindings_out_path.as_ref(),
&bindings_out_path,
);
}

Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pub use bindings::{
C_KZG_RET as CkzgError,
};

#[cfg(feature = "ethereum_kzg_settings")]
// Expose the default settings.
#[cfg(feature = "ethereum_kzg_settings")]
pub use ethereum_kzg_settings::{ethereum_kzg_settings, ethereum_kzg_settings_arc};

// Expose the constants.
Expand Down

0 comments on commit 1bccee0

Please sign in to comment.