@@ -90,15 +90,6 @@ if(EXECUTORCH_BUILD_CUDA)
9090 list (APPEND link_libraries aoti_cuda)
9191 # Handle both static library and shared library (.dll on Windows MSVC)
9292 executorch_target_link_options_shared_lib(aoti_cuda)
93- # On MSVC, ensure the DLL is copied to the output directory
94- if (MSVC )
95- add_custom_command (TARGET voxtral_runner POST_BUILD
96- COMMAND ${CMAKE_COMMAND} -E copy_if_different
97- $<TARGET_FILE:aoti_cuda>
98- $<TARGET_FILE_DIR:voxtral_runner>
99- COMMENT "Copying aoti_cuda.dll to output directory"
100- )
101- endif ()
10293endif ()
10394
10495if (EXECUTORCH_BUILD_METAL)
@@ -110,6 +101,16 @@ endif()
110101list (APPEND link_libraries tokenizers::tokenizers)
111102
112103add_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 ()
113114if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
114115 target_link_options_gc_sections(voxtral_runner)
115116 if (NOT APPLE )
0 commit comments