This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-ffi.git
The following commit(s) were added to refs/heads/main by this push:
new 2002e28 chore(build): Fix Windows Build (#134)
2002e28 is described below
commit 2002e28bcf94fee5e9b85014e59528284e470cfd
Author: Junru Shao <[email protected]>
AuthorDate: Wed Oct 15 11:32:39 2025 -0700
chore(build): Fix Windows Build (#134)
- Explicitly link `tvm_ffi_cython` to `Python::Module` or
`Python::SABIModule`
- Fallback to `InterlockedAdd64` if `_InlineInterlockedAdd64` is not
available
- Upgrade CI to test Python >= 3.10
---
.github/workflows/ci_test.yml | 2 +-
CMakeLists.txt | 2 ++
include/tvm/ffi/base_details.h | 4 ++++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci_test.yml b/.github/workflows/ci_test.yml
index e5361f3..0fa1554 100644
--- a/.github/workflows/ci_test.yml
+++ b/.github/workflows/ci_test.yml
@@ -80,7 +80,7 @@ jobs:
matrix:
include:
- {os: ubuntu-latest, arch: x86_64, python_version: '3.14t'}
- - {os: ubuntu-24.04-arm, arch: aarch64, python_version: '3.9'}
+ - {os: ubuntu-24.04-arm, arch: aarch64, python_version: '3.10'}
- {os: windows-latest, arch: AMD64, python_version: '3.12'}
- {os: macos-14, arch: arm64, python_version: '3.13'}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c4c69a..8928863 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -240,8 +240,10 @@ if (TVM_FFI_BUILD_PYTHON_MODULE)
if (Python_VERSION VERSION_GREATER_EQUAL "3.12" AND NOT
PYTHON_IS_FREE_THREADED)
# >= Python3.12, use Use_SABI version
python_add_library(tvm_ffi_cython MODULE "${_core_cpp}" USE_SABI 3.12)
+ target_link_libraries(tvm_ffi_cython PRIVATE Python::SABIModule)
set_target_properties(tvm_ffi_cython PROPERTIES OUTPUT_NAME "core")
if (NOT WIN32)
+ target_link_libraries(tvm_ffi_cython PRIVATE Python::Module)
set_target_properties(tvm_ffi_cython PROPERTIES SUFFIX ".abi3.so")
endif ()
else ()
diff --git a/include/tvm/ffi/base_details.h b/include/tvm/ffi/base_details.h
index 51d1b4f..4e83648 100644
--- a/include/tvm/ffi/base_details.h
+++ b/include/tvm/ffi/base_details.h
@@ -41,6 +41,10 @@
#endif
#include <windows.h>
+#if (defined(_M_ARM64) || defined(_ARM64_) || defined(_M_ARM64EC)) && \
+ !defined(_InlineInterlockedAdd64)
+#define _InlineInterlockedAdd64 InterlockedAdd64
+#endif
#ifdef ERROR
#undef ERROR