Skip to content

CMake: add option to disable leak warnings #385

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ else()
set(DRJIT_ENABLE_CUDA_DEFAULT ON)
endif()

option(DRJIT_ENABLE_LLVM "Build the Dr.Jit LLVM backend?" ON)
option(DRJIT_ENABLE_CUDA "Build the Dr.Jit CUDA backend?" ${DRJIT_ENABLE_CUDA_DEFAULT})
option(DRJIT_ENABLE_AUTODIFF "Build Dr.Jit automatic differentation library?" ON)
option(DRJIT_ENABLE_PYTHON "Build Python extension library?" ON)
option(DRJIT_ENABLE_TESTS "Build Dr.Jit test suite? (Warning, this takes *very* long to compile)" OFF)
if (SKBUILD)
set(DRJIT_ENABLE_LEAK_WARNINGS_DEFAULT OFF)
else()
set(DRJIT_ENABLE_LEAK_WARNINGS_DEFAULT ON)
endif()

option(DRJIT_ENABLE_LLVM "Build the Dr.Jit LLVM backend?" ON)
option(DRJIT_ENABLE_CUDA "Build the Dr.Jit CUDA backend?" ${DRJIT_ENABLE_CUDA_DEFAULT})
option(DRJIT_ENABLE_AUTODIFF "Build Dr.Jit automatic differentation library?" ON)
option(DRJIT_ENABLE_PYTHON "Build Python extension library?" ON)
option(DRJIT_ENABLE_TESTS "Build Dr.Jit test suite? (Warning, this takes *very* long to compile)" OFF)
option(DRJIT_ENABLE_LEAK_WARNINGS "Emit DrJit and nanobind leak warnings? By default, leak warnings are disabled automatically when building PyPi wheels." ${DRJIT_ENABLE_LEAK_WARNINGS_DEFAULT})

option(DRJIT_STABLE_ABI "Build Python extension using the CPython stable ABI? (Only relevant when using scikit-build)" OFF)
mark_as_advanced(DRJIT_STABLE_ABI)
Expand Down
4 changes: 2 additions & 2 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ if (DRJIT_ENABLE_CUDA)
target_compile_definitions(drjit-python PRIVATE -DDRJIT_ENABLE_CUDA)
endif()

# Disable leak warnings by default in PyPI release builds
if (SKBUILD)
# Disable DrJit and nanobind leak warnings (disabled by default in PyPi builds)
if (NOT DRJIT_ENABLE_LEAK_WARNINGS)
target_compile_definitions(drjit-python PRIVATE -DDRJIT_DISABLE_LEAK_WARNINGS)
endif()

Expand Down