Skip to content

Commit 7caecaa

Browse files
committed
Fix JNI
1 parent 4a49d13 commit 7caecaa

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

.github/workflows/windows-x64-jni.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ jobs:
5252
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
5353
-DBUILD_ESPEAK_NG_EXE=OFF \
5454
-DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \
55-
-DSHERPA_ONNX_ENABLE_BINARY=ON \
55+
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
56+
-DSHERPA_ONNX_ENABLE_C_API=OFF \
5657
..
5758
5859
- name: Build sherpa-onnx for windows
@@ -62,7 +63,6 @@ jobs:
6263
cmake --build . --config Release -- -m:2
6364
cmake --build . --config Release --target install -- -m:2
6465
65-
ls -lh ./bin/Release/sherpa-onnx.exe
6666
rm -rf install/share
6767
rm -rf install/lib/share
6868
rm -rf install/lib/pkgconfig
@@ -81,9 +81,9 @@ jobs:
8181
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64-jni
8282
mkdir -p $dst
8383
84-
cp -a build/install/bin $dst/
85-
cp -a build/install/lib $dst/
86-
cp -a build/install/include $dst/
84+
cp -a build/install/bin $dst/ || true
85+
cp -a build/install/lib $dst/ || true
86+
cp -a build/install/include $dst/ || true
8787
8888
tar cjvf ${dst}.tar.bz2 $dst
8989
@@ -122,12 +122,12 @@ jobs:
122122
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
123123
124124
- name: Release pre-compiled binaries and libs for Windows x64
125-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
125+
# if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
126126
uses: svenstaro/upload-release-action@v2
127127
with:
128128
file_glob: true
129129
overwrite: true
130130
file: sherpa-onnx-*.tar.bz2
131-
# repo_name: k2-fsa/sherpa-onnx
132-
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
133-
# tag: v1.12.0
131+
repo_name: k2-fsa/sherpa-onnx
132+
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
133+
tag: v1.12.18

sherpa-onnx/jni/common.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ namespace sherpa_onnx {
1515
1616
https://workbench.aihub.qualcomm.com/docs/hub/faq.html#why-am-i-seeing-error-1008-when-trying-to-use-htp
1717
*/
18+
#if defined(_WIN32)
19+
void PrependAdspLibraryPath(const std::string &new_path) {
20+
SHERPA_ONNX_LOGE("This function is not for Windows. Ignore it");
21+
}
22+
#else
1823
void PrependAdspLibraryPath(const std::string &new_path) {
1924
const char *old_path = getenv("ADSP_LIBRARY_PATH");
2025
std::string updated_path;
@@ -43,5 +48,6 @@ Successfully set ADSP_LIBRARY_PATH to
4348
4449
*/
4550
}
51+
#endif
4652

4753
} // namespace sherpa_onnx

0 commit comments

Comments
 (0)