forked from k2-fsa/sherpa-onnx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-swift-macos.sh
executable file
·45 lines (39 loc) · 1.23 KB
/
build-swift-macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -ex
dir=build-swift-macos
mkdir -p $dir
cd $dir
cmake \
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
-DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_INSTALL_PREFIX=./install \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
-DSHERPA_ONNX_ENABLE_JNI=OFF \
-DSHERPA_ONNX_ENABLE_C_API=ON \
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
../
make VERBOSE=1 -j4
make install
rm -fv ./install/include/cargs.h
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/libsherpa-onnx-fstfar.a \
./install/lib/libsherpa-onnx-fst.a \
./install/lib/libsherpa-onnx-kaldifst-core.a \
./install/lib/libkaldi-decoder-core.a \
./install/lib/libucd.a \
./install/lib/libpiper_phonemize.a \
./install/lib/libespeak-ng.a \
./install/lib/libssentencepiece_core.a
xcodebuild -create-xcframework \
-library install/lib/libsherpa-onnx.a \
-headers install/include \
-output sherpa-onnx.xcframework