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 97e4877f [BUILD] Enable MSVC inline COMDAT elimination (#874)
97e4877f is described below
commit 97e4877f53a788c148fd9eb7475f7a1d4c331a82
Author: Tianqi Chen <[email protected]>
AuthorDate: Sat Oct 24 14:32:57 2026 -0400
[BUILD] Enable MSVC inline COMDAT elimination (#874)
Enable `/Zc:inline` in the shared MSVC target helper to avoid emitting
unreferenced inline COMDAT definitions and their associated object
records.
Apply the option privately to C and C++ compilation. Preserve the
existing `MSVC_FLAGS OFF` opt-out and keep the option out of CUDA
compilation and downstream link interfaces.
---
cmake/Utils/Library.cmake | 1 +
1 file changed, 1 insertion(+)
diff --git a/cmake/Utils/Library.cmake b/cmake/Utils/Library.cmake
index 0e527d91..427a31d1 100644
--- a/cmake/Utils/Library.cmake
+++ b/cmake/Utils/Library.cmake
@@ -74,6 +74,7 @@ function (tvm_ffi_add_msvc_flags target_name)
# per-object section limit (C1128). Apply /bigobj to every target that
uses these flags so
# growth in any TU doesn't break the Windows build.
target_compile_options(${target_name} PRIVATE "/bigobj")
+ target_compile_options(${target_name} PRIVATE
"$<$<COMPILE_LANGUAGE:C,CXX>:/Zc:inline>")
endif ()
endfunction ()