Skip to content

How to disable leak warnings for wheel builds? #968

Closed Answered by nurpax
nurpax asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like I figured it out. For posteriority, here's what worked.

Extension code:

--- a/src/slimgui_ext.cpp
+++ b/src/slimgui_ext.cpp
@@ -68,6 +68,9 @@ static int InputTextCallback(ImGuiInputTextCallbackData* data)
 }

 NB_MODULE(slimgui_ext, m) {
+#if SLIMGUI_DISABLE_LEAK_CHECKS == 1
+    nb::set_leak_warnings(false);
+#endif

     m.attr("IMGUI_VERSION") = IMGUI_VERSION;
     m.attr("IMGUI_VERSION_NUM") = IMGUI_VERSION_NUM;

CMakeLists.txt change:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,12 +10,20 @@ find_package(Python 3.8
 # Import nanobind through CMake's find_package mechanism
 find_package(nanobind CONFIG REQUIRED)

+# Disable leak checks if requested (usually by cibuildwh…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nurpax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant