Skip to content

Commit 35c602a

Browse files
committed
Another go at disabling leak checks for CI builds
1 parent ce48db9 commit 35c602a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/wheels.yml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
submodules: true
4646

4747
- uses: pypa/[email protected]
48+
env:
49+
CIBW_ENVIRONMENT: SLIMGUI_DISABLE_LEAK_CHECKS=1
4850

4951
# - name: Verify clean directory
5052
# run: git diff --exit-code

CMakeLists.txt

+8-10
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ find_package(Python 3.8
1010
# Import nanobind through CMake's find_package mechanism
1111
find_package(nanobind CONFIG REQUIRED)
1212

13+
# Disable leak checks if requested (usually by cibuildwheel in CI)
14+
if (DEFINED ENV{SLIMGUI_DISABLE_LEAK_CHECKS})
15+
set(DISABLE_LEAK_CHECKS 1)
16+
else()
17+
set(DISABLE_LEAK_CHECKS 0)
18+
endif()
19+
1320
#add_definitions(-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1)
14-
add_definitions(-DIMGUI_DISABLE_OBSOLETE_KEYIO=1)
21+
add_definitions(-DIMGUI_DISABLE_OBSOLETE_KEYIO=1 -DSLIMGUI_DISABLE_LEAK_CHECKS=${DISABLE_LEAK_CHECKS})
1522

1623
nanobind_add_module(slimgui_ext
1724
NB_STATIC
@@ -34,15 +41,6 @@ nanobind_add_stub(
3441
DEPENDS slimgui_ext
3542
)
3643

37-
# Check for an environment variable
38-
if (DEFINED ENV{CIBW_BUILD})
39-
set(DISABLE_LEAK_CHECKS 1)
40-
else()
41-
set(DISABLE_LEAK_CHECKS 0)
42-
endif()
43-
44-
target_compile_definitions(slimgui_ext PRIVATE SLIMGUI_DISABLE_LEAK_CHECKS=${DISABLE_LEAK_CHECKS})
45-
4644
include_directories(${CMAKE_SOURCE_DIR}/src/c/imgui)
4745

4846
install(TARGETS slimgui_ext LIBRARY DESTINATION slimgui)

0 commit comments

Comments
 (0)