Skip to content

Commit d326314

Browse files
committed
Fix Cython warning caused by cimporting from Numpy
When using cimport with Numpy, a warning for a deprecated C-API is thrown NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION is now defined for targets in `build_dpctl_ext` to address this warning
1 parent a250506 commit d326314

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dpctl/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ function(build_dpctl_ext _trgt _src _dest)
125125
)
126126
endif()
127127
endif()
128+
# needed to prevent warnings from Cython caused by cimporting from Numpy
129+
target_compile_definitions(${_trgt} PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
128130
target_link_libraries(${_trgt} PRIVATE Python::NumPy)
129131
if (DPCTL_GENERATE_COVERAGE)
130132
target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)

0 commit comments

Comments
 (0)