Skip to content

Commit

Permalink
Fix linker issue (#357)
Browse files Browse the repository at this point in the history
* Expose VAD isDetected api to Swift

* Fix link issue
  • Loading branch information
yujinqiu authored Oct 12, 2023
1 parent f6566c8 commit 6479514
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 10 additions & 3 deletions build-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ cmake --build build/os64 --target install
echo "Generate xcframework"

mkdir -p "build/simulator/lib"
for f in libkaldi-native-fbank-core.a libsherpa-onnx-c-api.a libsherpa-onnx-core.a; do
for f in libkaldi-native-fbank-core.a libsherpa-onnx-c-api.a libsherpa-onnx-core.a \
libsherpa-onnx-fst.a libsherpa-onnx-kaldifst-core.a libkaldi-decoder-core.a; do
lipo -create build/simulator_arm64/lib/${f} \
build/simulator_x86_64/lib/${f} \
-output build/simulator/lib/${f}
Expand All @@ -138,12 +139,18 @@ done
libtool -static -o build/simulator/sherpa-onnx.a \
build/simulator/lib/libkaldi-native-fbank-core.a \
build/simulator/lib/libsherpa-onnx-c-api.a \
build/simulator/lib/libsherpa-onnx-core.a
build/simulator/lib/libsherpa-onnx-core.a \
build/simulator/lib/libsherpa-onnx-fst.a \
build/simulator/lib/libsherpa-onnx-kaldifst-core.a \
build/simulator/lib/libkaldi-decoder-core.a

libtool -static -o build/os64/sherpa-onnx.a \
build/os64/lib/libkaldi-native-fbank-core.a \
build/os64/lib/libsherpa-onnx-c-api.a \
build/os64/lib/libsherpa-onnx-core.a
build/os64/lib/libsherpa-onnx-core.a \
build/os64/lib/libsherpa-onnx-fst.a \
build/os64/lib/libsherpa-onnx-kaldifst-core.a \
build/os64/lib/libkaldi-decoder-core.a


rm -rf sherpa-onnx.xcframework
Expand Down
5 changes: 4 additions & 1 deletion build-swift-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ make install
libtool -static -o ./install/lib/libsherpa-onnx.a \
./install/lib/libsherpa-onnx-c-api.a \
./install/lib/libsherpa-onnx-core.a \
./install/lib/libkaldi-native-fbank-core.a
./install/lib/libkaldi-native-fbank-core.a \
./install/lib/libsherpa-onnx-fst.a \
./install/lib/libsherpa-onnx-kaldifst-core.a \
./install/lib/libkaldi-decoder-core.a

0 comments on commit 6479514

Please sign in to comment.