From f7142289ad2cfdea393be4a4d3b103e4a31ca548 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 20 Apr 2024 18:36:32 -0400 Subject: [PATCH] fix build Signed-off-by: Jinzhe Zeng --- CMakeLists.txt | 14 +++++++++----- pyproject.toml | 1 - 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2571dd2..c8bd993 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 6626192..d4f7bc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,6 @@ requires = [ "scikit-build-core>=0.9.0", "cython>=3.0.1", - "cython-cmake", ] build-backend = "scikit_build_core.build"