I have a Cython module that calls a C++ function via cdef extern
. The C++ function has assert()
statements, and I would like to check those assertions. However, when I create the module by calling python setup.py build_ext --inplace
, GCC is always invoked with -DNDEBUG
. Whenever the code is run, the assertions are not checked.
I can't find a way to override -DNDEBUG
using setup.py
. Is this possible?
Currently the only way I have found to deal with this is to manually call Cython, GCC, and g++
with the options that are used by python setup.py
, but to take out -DNDEBUG
. But there must be a simpler way.