Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rust): define NDEBUG when debug assertions are off #450

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading