@@ -33,13 +33,14 @@ concurrency:
3333jobs :
3434 pkg_config :
3535 runs-on : ${{ matrix.os }}
36- name : ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.lib_type }}
36+ name : ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.lib_type }} tts-${{ matrix.tts }}
3737 strategy :
3838 fail-fast : false
3939 matrix :
4040 os : [ubuntu-latest, macos-latest]
4141 build_type : [Release, Debug]
4242 lib_type : [shared, static]
43+ tts : [ON, OFF]
4344
4445 steps :
4546 - uses : actions/checkout@v4
@@ -67,12 +68,12 @@ jobs:
6768 mkdir build
6869 cd build
6970 if [[ ${{ matrix.lib_type }} == "shared" ]]; then
70- cmake -DSHERPA_ONNX_ENABLE_C_API=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=ON ..
71+ cmake -DSHERPA_ONNX_ENABLE_TTS=${{ matrix.tts }} - DSHERPA_ONNX_ENABLE_C_API=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=ON ..
7172 else
72- cmake -DSHERPA_ONNX_ENABLE_C_API=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=OFF ..
73+ cmake -DSHERPA_ONNX_ENABLE_TTS=${{ matrix.tts }} - DSHERPA_ONNX_ENABLE_C_API=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=OFF ..
7374 fi
7475
75- - name : Build sherpa-onnx for ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.lib_type }}
76+ - name : Build sherpa-onnx for ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.lib_type }} tts-${{ matrix.tts }}
7677 shell : bash
7778 run : |
7879 export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
@@ -104,16 +105,36 @@ jobs:
104105
105106 cat build/install/sherpa-onnx.pc
106107
108+ - name : Show pkg-config
109+ shell : bash
110+ run : |
111+ export PKG_CONFIG_PATH=$PWD/build/install:$PKG_CONFIG_PATH
112+ pkg-config --cflags sherpa-onnx
113+ pkg-config --libs sherpa-onnx
114+
107115 - name : Build C API example
108116 shell : bash
109117 run : |
110118 export PKG_CONFIG_PATH=$PWD/build/install:$PKG_CONFIG_PATH
111119 cd c-api-examples
112120
121+ pkg-config --cflags sherpa-onnx
122+
113123 gcc -o decode-file-c-api $(pkg-config --cflags sherpa-onnx) ./decode-file-c-api.c $(pkg-config --libs sherpa-onnx)
124+
114125 ./decode-file-c-api --help
115126
127+ - name : Build C API example (tts)
128+ if : matrix.tts == 'ON'
129+ shell : bash
130+ run : |
131+ export PKG_CONFIG_PATH=$PWD/build/install:$PKG_CONFIG_PATH
132+ cd c-api-examples
133+
134+ pkg-config --cflags sherpa-onnx
135+
116136 gcc -o offline-tts-c-api $(pkg-config --cflags sherpa-onnx) ./offline-tts-c-api.c $(pkg-config --libs sherpa-onnx)
137+
117138 ./offline-tts-c-api --help
118139
119140 - name : Test online transducer (C API)
@@ -126,5 +147,5 @@ jobs:
126147
127148 - uses : actions/upload-artifact@v4
128149 with :
129- name : tts-generated-test-files-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.lib_type }}
150+ name : tts-generated-test-files-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.lib_type }}-tts-${{ matrix.tts }}
130151 path : tts
0 commit comments