We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8d7ae6 commit 4ebbcd8Copy full SHA for 4ebbcd8
rdkafka-sys/build.rs
@@ -276,6 +276,13 @@ fn build_librdkafka() {
276
env::set_var("CMAKE_LIBRARY_PATH", cmake_library_paths.join(";"));
277
}
278
279
+ // When builing with `CMAKE_BUILD_TYPE=Release`, cmake automatically
280
+ // sets `-DNDEBUG` flags. This breaks librdkafka, which uses asserts for
281
+ // runtime error checking (confluentinc/librdkafka#5099). We unset
282
+ // `NDEBUG` by manually overwriting the cmake's `C_FLAGS` variables.
283
+ config.define("CMAKE_C_FLAGS_RELEASE", "-O3 -UNDEBUG");
284
+ config.define("CMAKE_CXX_FLAGS_RELEASE", "-O3 -UNDEBUG");
285
+
286
println!("Configuring and compiling librdkafka");
287
let dst = config.build();
288
0 commit comments