File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,14 @@ set(_aoti_cuda_sources
4444    runtime/shims/int4mm.cu
4545    runtime/platform/platform.cpp
4646)
47- add_library (aoti_cuda STATIC  ${_aoti_cuda_sources} )
47+ # Build as SHARED library (.dll) on Windows MSVC, otherwise STATIC 
48+ if (MSVC )
49+   add_library (aoti_cuda SHARED ${_aoti_cuda_sources} )
50+   # Define export macro for Windows DLL 
51+   target_compile_definitions (aoti_cuda PRIVATE  EXPORT_AOTI_FUNCTIONS)
52+ else ()
53+   add_library (aoti_cuda STATIC  ${_aoti_cuda_sources} )
54+ endif ()
4855target_include_directories (
4956  aoti_cuda
5057  PUBLIC  ${CUDAToolkit_INCLUDE_DIRS} 
Original file line number Diff line number Diff line change 8888if (EXECUTORCH_BUILD_CUDA)
8989  find_package (CUDAToolkit REQUIRED)
9090  list (APPEND  link_libraries  aoti_cuda)
91+   # Handle both static library and shared library (.dll on Windows MSVC) 
9192  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 ()
92102endif ()
93103
94104if (EXECUTORCH_BUILD_METAL)
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments