Jingzhao Ou
Committed by GitHub

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

@@ -247,7 +247,11 @@ endif() @@ -247,7 +247,11 @@ endif()
247 message(STATUS "location_onnxruntime_header_dir: ${location_onnxruntime_header_dir}") 247 message(STATUS "location_onnxruntime_header_dir: ${location_onnxruntime_header_dir}")
248 248
249 if(DEFINED ENV{SHERPA_ONNXRUNTIME_LIB_DIR}) 249 if(DEFINED ENV{SHERPA_ONNXRUNTIME_LIB_DIR})
250 - set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.so) 250 + if(APPLE)
  251 + set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.dylib)
  252 + else()
  253 + set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.so)
  254 + endif()
251 if(NOT EXISTS ${location_onnxruntime_lib}) 255 if(NOT EXISTS ${location_onnxruntime_lib})
252 set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.a) 256 set(location_onnxruntime_lib $ENV{SHERPA_ONNXRUNTIME_LIB_DIR}/libonnxruntime.a)
253 endif() 257 endif()