Fix build processes (#545)

* Let CMake read version numbers from the `VERSION` file.
* Upgrade dlpack and drop `CMAKE_POLICY_VERSION_MINIMUM`.
* Do not install dlpack.
* Add license files in the wheel and exclude `*.cpp` files.
This commit is contained in:
Changho Hwang
2025-06-06 13:37:40 -07:00
committed by GitHub
parent f694f2e46b
commit 17d8e7c9e9
3 changed files with 26 additions and 11 deletions

View File

@@ -6,8 +6,17 @@ include(FetchContent)
FetchContent_Declare(nanobind GIT_REPOSITORY https://github.com/wjakob/nanobind.git GIT_TAG v1.4.0)
FetchContent_MakeAvailable(nanobind)
FetchContent_Declare(dlpack GIT_REPOSITORY https://github.com/dmlc/dlpack.git GIT_TAG v1.1)
FetchContent_MakeAvailable(dlpack)
FetchContent_Declare(dlpack
GIT_REPOSITORY https://github.com/dmlc/dlpack.git
GIT_TAG 5c210da409e7f1e51ddf445134a4376fdbd70d7d
)
FetchContent_GetProperties(dlpack)
if(NOT dlpack_POPULATED)
FetchContent_Populate(dlpack)
# Add dlpack subdirectory but exclude it from installation
add_subdirectory(${dlpack_SOURCE_DIR} ${dlpack_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cpp)
nanobind_add_module(mscclpp_py ${SOURCES})