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-tirx.git
The following commit(s) were added to refs/heads/main by this push:
new 714273197 [BUILD] Enable MSVC inline COMDAT elimination for TIRx
targets (#41)
714273197 is described below
commit 714273197aa396c66b7bd50060442fbe9667c39c
Author: Tianqi Chen <[email protected]>
AuthorDate: Sat Oct 24 14:32:17 2026 -0400
[BUILD] Enable MSVC inline COMDAT elimination for TIRx targets (#41)
Enable `/Zc:inline` for C and C++ compilation in the shared TIRx target
configuration helper. Keep the option private to MSVC targets so it does
not propagate to consumers or CUDA compilation.
---
cmake/utils/Library.cmake | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmake/utils/Library.cmake b/cmake/utils/Library.cmake
index 506bf96fa..8319f38aa 100644
--- a/cmake/utils/Library.cmake
+++ b/cmake/utils/Library.cmake
@@ -26,6 +26,10 @@ function(tvm_tirx_configure_target target)
set_property(TARGET ${target} PROPERTY CXX_VISIBILITY_PRESET hidden)
set_property(TARGET ${target} PROPERTY VISIBILITY_INLINES_HIDDEN ON)
+ if(MSVC)
+ target_compile_options(${target} PRIVATE
"$<$<COMPILE_LANGUAGE:C,CXX>:/Zc:inline>")
+ endif()
+
# Keep shared libraries relocatable within their installation directory.
if(APPLE)
set_target_properties(${target} PROPERTIES BUILD_RPATH "@loader_path"
INSTALL_RPATH "@loader_path")