Support linking onnxruntime lib statically on Linux (#326)

This commit is contained in:
Fangjun Kuang
2023-09-21 10:15:42 +08:00
committed by GitHub
parent f5c060dd61
commit 532ed142d2
8 changed files with 106 additions and 7 deletions

View File

@@ -12,8 +12,10 @@ function(download_onnxruntime)
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
if(SHERPA_ONNX_ENABLE_GPU)
include(onnxruntime-linux-x86_64-gpu)
else()
elseif(BUILD_SHARED_LIBS)
include(onnxruntime-linux-x86_64)
else()
include(onnxruntime-linux-x86_64-static)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
if (arm64 IN_LIST CMAKE_OSX_ARCHITECTURES AND x86_64 IN_LIST CMAKE_OSX_ARCHITECTURES)