Skip to content

Commit

Permalink
fix CI test errors for swift
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Aug 17, 2024
1 parent 860a1ab commit 8495fea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ https://github.com/k2-fsa/sherpa-ncnn/releases/tag/models

### Useful links

- Documentation: https://k2-fsa.github.io/sherpa/onnx/
- Documentation: https://k2-fsa.github.io/sherpa/ncnn/
- Bilibili 演示视频: https://search.bilibili.com/all?keyword=%E6%96%B0%E4%B8%80%E4%BB%A3Kaldi

### How to reach us
Expand Down
4 changes: 3 additions & 1 deletion build-swift-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if [ ! -f openmp-11.0.0.src/build/install/include/omp.h ]; then
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DLIBOMP_ENABLE_SHARED=OFF \
-DLIBOMP_OMPT_SUPPORT=OFF \
-DLIBOMP_USE_HWLOC=OFF ..
Expand All @@ -51,6 +52,7 @@ mkdir -p build
pushd build

cmake \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DOpenMP_C_FLAGS="-Xclang -fopenmp" \
-DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
-DOpenMP_C_LIB_NAMES="libomp" \
Expand Down Expand Up @@ -92,7 +94,7 @@ xcodebuild -create-xcframework \
mkdir -p sherpa-ncnn.xcframework/Headers
cp -av build/install/include/* sherpa-ncnn.xcframework/Headers

pushd sherpa-ncnn.xcframework/macos/
pushd sherpa-ncnn.xcframework/macos-arm64_x86_64/
ln -s sherpa-ncnn.a libsherpa-ncnn.a
popd

Expand Down
4 changes: 2 additions & 2 deletions swift-api-examples/run-decode-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if [ ! -e ./decode-file ]; then
-I ../build-swift-macos/sherpa-ncnn.xcframework/Headers/ \
-import-objc-header ./SherpaNcnn-Bridging-Header.h \
./decode-file.swift ./SherpaNcnn.swift \
-L ../build-swift-macos/openmp.xcframework/macos-x86_64 \
-L ../build-swift-macos/sherpa-ncnn.xcframework/macos-x86_64 \
-L ../build-swift-macos/openmp.xcframework/macos-arm64_x86_64 \
-L ../build-swift-macos/sherpa-ncnn.xcframework/macos-arm64_x86_64 \
-l sherpa-ncnn \
-l omp \
-o decode-file
Expand Down

0 comments on commit 8495fea

Please sign in to comment.