From 629c3f06851b68430ba2d3444abd500140e4cc4c Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Fri, 18 Oct 2024 17:57:31 +0200 Subject: [PATCH] Fix some Cython extension definitions and defines in `CythonExtension.cmake` --- src/scripts/cmake/CythonExtension.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scripts/cmake/CythonExtension.cmake b/src/scripts/cmake/CythonExtension.cmake index 221289c..f0b35e8 100644 --- a/src/scripts/cmake/CythonExtension.cmake +++ b/src/scripts/cmake/CythonExtension.cmake @@ -55,8 +55,8 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug) else() set(CYTHON_DIRECTIVES ${CYTHON_DIRECTIVES} - -X boundscheck=True - -X wraparound=True + -X boundscheck=False + -X wraparound=False ) endif() @@ -110,8 +110,10 @@ macro(cython_extension _name) if(CMAKE_BUILD_TYPE STREQUAL Debug) if(NOT Python_INTERPRETER_ID STREQUAL PyPy) - target_compile_definitions(${_target} PUBLIC CYTHON_TRACE=1) + target_compile_definitions(${_target} PUBLIC CYTHON_TRACE_NOGIL=1) endif() + else() + target_compile_definitions(${_target} PUBLIC CYTHON_WITHOUT_ASSERTIONS=1) endif() # Preserve the relative project structure in the install directory