fixed broken build when user provides their own onnxruntime library (#201)

This commit is contained in:
Jingzhao Ou
2023-07-06 23:26:09 -07:00
committed by GitHub
parent a8599507ca
commit 27762bb169

View File

@@ -247,7 +247,11 @@ endif()
message(STATUS "location_onnxruntime_header_dir: ${location_onnxruntime_header_dir}")
if(DEFINED ENV{SHERPA_ONNXRUNTIME_LIB_DIR})
set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.so)
if(APPLE)
set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.dylib)
else()
set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.so)
endif()
if(NOT EXISTS ${location_onnxruntime_lib})
set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.a)
endif()