Skip to content

Commit

Permalink
fix windows build (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
endink authored Nov 16, 2024
1 parent b28b0c8 commit e993c08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ if(SHERPA_ONNX_USE_PRE_INSTALLED_ONNXRUNTIME_IF_AVAILABLE)
if(DEFINED ENV{SHERPA_ONNXRUNTIME_LIB_DIR})
if(APPLE)
set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.dylib)
elseif(WIN32)
set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/onnxruntime.lib)
else()
set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.so)
endif()
Expand Down Expand Up @@ -198,6 +200,7 @@ if(location_onnxruntime_header_dir AND location_onnxruntime_lib)
add_library(onnxruntime SHARED IMPORTED)
set_target_properties(onnxruntime PROPERTIES
IMPORTED_LOCATION ${location_onnxruntime_lib}
IMPORTED_IMPLIB ${location_onnxruntime_lib}
INTERFACE_INCLUDE_DIRECTORIES "${location_onnxruntime_header_dir}"
)
if(SHERPA_ONNX_ENABLE_GPU AND location_onnxruntime_cuda_lib)
Expand Down

0 comments on commit e993c08

Please sign in to comment.