Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Added debug arguments to cython call when in debug build type
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Sep 18, 2023
1 parent ba23e4f commit c7d4942
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ build-backend = "scikit_build_core.build"
cmake.args = ["-DUSE_SIMD=OFF"]
sdist.include = ["src/globals/globals_module.f90.in","swiftest/*.py","swiftest/*.pyx","swiftest/*.h"]
build-dir = "build/{wheel_tag}"
cmake.verbose = true

[tool.cibuildwheel]
test-command = "pytest {package}/tests"
Expand Down
8 changes: 6 additions & 2 deletions swiftest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ FIND_PROGRAM(CYTHON
NO_CMAKE_FIND_ROOT_PATH
)
MESSAGE(STATUS "Cython executable path: ${CYTHON}")
SET(CYTHON_ARGS "${CMAKE_CURRENT_SOURCE_DIR}/${SWIFTEST_BINDINGS}.pyx" "--output-file" "${CMAKE_CURRENT_BINARY_DIR}/${SWIFTEST_BINDINGS}.c")
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" BT)
IF (BT STREQUAL "DEBUG")
LIST(APPEND CYTHON_ARGS "--gdb")
endif ()
ADD_CUSTOM_COMMAND(
OUTPUT "${SWIFTEST_BINDINGS}.c"
DEPENDS "${SWIFTEST_BINDINGS}.pyx"
VERBATIM
COMMAND "${CYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/${SWIFTEST_BINDINGS}.pyx" --output-file
"${CMAKE_CURRENT_BINARY_DIR}/${SWIFTEST_BINDINGS}.c")
COMMAND "${CYTHON}" ${CYTHON_ARGS} )

PYTHON_ADD_LIBRARY(${SWIFTEST_BINDINGS} MODULE "${CMAKE_CURRENT_BINARY_DIR}/${SWIFTEST_BINDINGS}.c" WITH_SOABI)

Expand Down

0 comments on commit c7d4942

Please sign in to comment.