Add go-api-examples (#219)

This commit is contained in:
Fangjun Kuang
2023-07-21 17:56:09 +08:00
committed by GitHub
parent 6125d9e063
commit e63d205b3d
28 changed files with 1624 additions and 14 deletions

View File

@@ -8,10 +8,6 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
message(FATAL_ERROR "This file is for macOS only. Given: ${CMAKE_SYSTEM_NAME}")
endif()
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
message(FATAL_ERROR "This file is for arm64 only. Given: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-osx-arm64-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-osx-arm64-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=df97832fc7907c6677a6da437f92339d84a462becb74b1d65217fcb859ee9460")

View File

@@ -8,10 +8,6 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
message(FATAL_ERROR "This file is for macOS only. Given: ${CMAKE_SYSTEM_NAME}")
endif()
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
message(FATAL_ERROR "This file is for x86_64 only. Given: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
set(onnxruntime_URL "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/onnxruntime-osx-x86_64-1.15.1.tgz")
set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-osx-x86_64-1.15.1.tgz")
set(onnxruntime_HASH "SHA256=4b66ebbca24b8b96f6b74655fee3610a7e529b4e01f6790632f24ee82b778e5a")

View File

@@ -16,12 +16,18 @@ function(download_onnxruntime)
include(onnxruntime-linux-x86_64)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
if (arm64 IN_LIST CMAKE_OSX_ARCHITECTURES OR x86_64 IN_LIST CMAKE_OSX_ARCHITECTURES)
include(onnxruntime-darwin-universal)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
include(onnxruntime-darwin-x86_64)
if (arm64 IN_LIST CMAKE_OSX_ARCHITECTURES AND x86_64 IN_LIST CMAKE_OSX_ARCHITECTURES)
include(onnxruntime-osx-universal)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
# cross compiling
include(onnxruntime-osx-arm64)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm64 AND CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
# cross compiling
include(onnxruntime-osx-x86_64)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
include(onnxruntime-darwin-arm64)
include(onnxruntime-osx-arm64)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
include(onnxruntime-osx-x86_64)
else()
message(FATAL_ERROR "Unsupport processor {CMAKE_SYSTEM_PROCESSOR} for Darwin")
endif()