From 27762bb16999e5fbe17115aa85853f9ce132e672 Mon Sep 17 00:00:00 2001 From: Jingzhao Ou Date: Thu, 6 Jul 2023 23:26:09 -0700 Subject: [PATCH] fixed broken build when user provides their own onnxruntime library (#201) --- cmake/onnxruntime.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/onnxruntime.cmake b/cmake/onnxruntime.cmake index 76ab5c4d..8d4ba378 100644 --- a/cmake/onnxruntime.cmake +++ b/cmake/onnxruntime.cmake @@ -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()