From e993c0853824ff3bdc8332ff2a1416402fd97755 Mon Sep 17 00:00:00 2001 From: Anders Xiao Date: Sat, 16 Nov 2024 11:57:10 +0800 Subject: [PATCH] fix windows build (#1546) --- cmake/onnxruntime.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/onnxruntime.cmake b/cmake/onnxruntime.cmake index 14b47bd2..6ed15c29 100644 --- a/cmake/onnxruntime.cmake +++ b/cmake/onnxruntime.cmake @@ -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() @@ -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)