Build sherpa-onnx as a single shared library (#1078)

When `-D BUILD_SHARED_LIBS=ON` is passed to `cmake`, it builds a single shared library.

Specifically, 

- For C APIs, it builds `libsherpa-onnx-c-api.so`
- For Python APIs, it builds `_sherpa_onnx.cpython-xx-xx.so`
- For Kotlin and Java APIs, it builds `libsherpa-onnx-jni.so`

There is no `libsherpa-onnx-core.so` any longer.

Note it affects only shared libraries.
This commit is contained in:
Fangjun Kuang
2024-07-06 16:41:54 +08:00
committed by GitHub
parent 55decb7bee
commit a25075101c
69 changed files with 571 additions and 324 deletions

View File

@@ -99,7 +99,12 @@ jobs:
mkdir build
cd build
cmake -DSHERPA_ONNX_ENABLE_TTS=${{ matrix.with_tts }} -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install ..
cmake \
-D SHERPA_ONNX_ENABLE_TTS=${{ matrix.with_tts }} \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} \
-D CMAKE_INSTALL_PREFIX=./install \
..
make -j2
make install
@@ -107,6 +112,12 @@ jobs:
ls -lh lib
ls -lh bin
echo "----"
ls -lh install/lib
echo "----"
ls -lh install/bin
- name: Display dependencies of sherpa-onnx for linux
shell: bash
run: |