Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Apr 20, 2024
1 parent 694a6b0 commit f714228
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ find_package(
COMPONENTS Interpreter Development.Module
REQUIRED)

find_package(Cython REQUIRED)
add_custom_command(
OUTPUT dps.cpp
COMMENT
"Making ${CMAKE_CURRENT_BINARY_DIR}/dps.cpp from ${CMAKE_CURRENT_SOURCE_DIR}/mddatasetbuilder/dps.pyx"
COMMAND Python::Interpreter -m cython
"${CMAKE_CURRENT_SOURCE_DIR}/mddatasetbuilder/dps.pyx" --output-file dps.cpp
DEPENDS mddatasetbuilder/dps.pyx
VERBATIM)

cython_compile_pyx(${CMAKE_CURRENT_BINARY_DIR}/dps.pyx OUTPUT_VAR
_dps_source_files)

python_add_library(dps MODULE ${_dps_source_files}
python_add_library(dps MODULE ${CMAKE_CURRENT_BINARY_DIR}/dps.cpp
${CMAKE_CURRENT_BINARY_DIR}/c_stack.cpp WITH_SOABI)
target_compile_definitions(dps PRIVATE CYTHON_LIMITED_API=1
Py_LIMITED_API=0x03070000)
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
requires = [
"scikit-build-core>=0.9.0",
"cython>=3.0.1",
"cython-cmake",
]
build-backend = "scikit_build_core.build"

Expand Down

0 comments on commit f714228

Please sign in to comment.