forked from k2-fsa/sherpa-onnx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-swift-macos.sh
executable file
·62 lines (49 loc) · 1.63 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/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/sherpa-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 \
./install/lib/onnxruntime_arm64.a
xcodebuild -create-xcframework \
-library "install/lib/libsherpa-onnx.a" \
-output sherpa-onnx_macos.xcframework
mkdir -p sherpa-onnx_macos.xcframework/Headers
cp -av install/include/* sherpa-onnx_macos.xcframework/Headers
pushd sherpa-onnx_macos.xcframework/macos-arm64
ln -s sherpa-onnx.a libsherpa-onnx.a
# ./install/lib/libssentencepiece_core.a
#
#xcodebuild -create-xcframework \
# -library install/lib/libsherpa-onnx.a \
# -headers install/include \
# -output sherpa-onnx.xcframework