Skip to content

Commit 450b6fb

Browse files
committed
cmake dll install changes
1 parent 3368248 commit 450b6fb

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

backends/cuda/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ if(MSVC)
4949
add_library(aoti_cuda SHARED ${_aoti_cuda_sources})
5050
# Define export macro for Windows DLL
5151
target_compile_definitions(aoti_cuda PRIVATE EXPORT_AOTI_FUNCTIONS)
52+
# Ensure proper DLL import/export library naming on Windows
53+
set_target_properties(aoti_cuda PROPERTIES
54+
WINDOWS_EXPORT_ALL_SYMBOLS OFF # We use explicit exports via AOTI_CUDA_EXPORT
55+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
56+
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
57+
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
58+
)
5259
else()
5360
add_library(aoti_cuda STATIC ${_aoti_cuda_sources})
5461
endif()
@@ -89,5 +96,7 @@ endif()
8996
install(
9097
TARGETS aoti_cuda
9198
EXPORT ExecuTorchTargets
92-
DESTINATION lib
99+
LIBRARY DESTINATION lib
100+
ARCHIVE DESTINATION lib
101+
RUNTIME DESTINATION bin
93102
)

examples/models/voxtral/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,6 @@ endif()
101101
list(APPEND link_libraries tokenizers::tokenizers)
102102

103103
add_executable(voxtral_runner ${_srcs})
104-
105-
# On MSVC, ensure the aoti_cuda DLL is copied to the output directory
106-
if(EXECUTORCH_BUILD_CUDA AND MSVC)
107-
add_custom_command(TARGET voxtral_runner POST_BUILD
108-
COMMAND ${CMAKE_COMMAND} -E copy_if_different
109-
$<TARGET_FILE:aoti_cuda>
110-
$<TARGET_FILE_DIR:voxtral_runner>
111-
COMMENT "Copying aoti_cuda.dll to output directory"
112-
)
113-
endif()
114104
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
115105
target_link_options_gc_sections(voxtral_runner)
116106
if(NOT APPLE)

0 commit comments

Comments
 (0)