Support linux aarch64 for Dart and Flutter (#2342)

Adds support for building and packaging Linux AArch64 (arm64) artifacts alongside x64 for Dart/Flutter plugins.

- Detects host architecture in CMake and adjusts library paths
- Extends test workflows to run on an ARM runner and handle linux-aarch64 paths
- Splits release pipeline into separate x64 and aarch64 build/package jobs
This commit is contained in:
Fangjun Kuang
2025-07-04 19:33:48 +08:00
committed by GitHub
parent 3bf986d08d
commit 53a3ad366b
7 changed files with 206 additions and 53 deletions

View File

@@ -7,11 +7,19 @@ cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME "sherpa_onnx_linux")
project(${PROJECT_NAME} LANGUAGES CXX)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(LIB_ARCH_DIR "x64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(LIB_ARCH_DIR "aarch64")
else()
message(FATAL_ERROR "Unsupported arch: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
# List of absolute paths to libraries that should be bundled with the plugin.
# This list could contain prebuilt libraries, or libraries created by an
# external build triggered from this build file.
set(sherpa_onnx_linux_bundled_libraries
"${CMAKE_CURRENT_SOURCE_DIR}/libsherpa-onnx-c-api.so"
"${CMAKE_CURRENT_SOURCE_DIR}/libonnxruntime.so"
"${CMAKE_CURRENT_SOURCE_DIR}/${LIB_ARCH_DIR}/libsherpa-onnx-c-api.so"
"${CMAKE_CURRENT_SOURCE_DIR}/${LIB_ARCH_DIR}/libonnxruntime.so"
PARENT_SCOPE
)