forked from jmpews/Dobby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_fat_dylib.sh
59 lines (43 loc) · 1.03 KB
/
build_fat_dylib.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
#!/bin/sh
# if error, exit
set -
BuildPath=$(dirname "$0")
# build aarch64
mkdir -p ${BuildPath}/temp_build_aarch64
cd temp_build_aarch64
cmake ../.. \
-DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake \
-DPLATFORM=OS64 \
-DARCHS=arm64 \
-DENABLE_BITCODE=0 \
-DENABLE_ARC=0 \
-DENABLE_VISIBILITY=0 \
-DDEPLOYMENT_TARGET=9.3 \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DSHARED=ON \
make -j4
cd ..
# build ios simulator
mkdir -p ${BuildPath}/temp_build_simulator_x86_64
cd temp_build_simulator_x86_64
cmake ../.. \
-DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake \
-DPLATFORM=SIMULATOR64 \
-DARCHS=x86_64 \
-DENABLE_BITCODE=0 \
-DENABLE_ARC=0 \
-DENABLE_VISIBILITY=0 \
-DDEPLOYMENT_TARGET=9.3 \
-DCMAKE_SYSTEM_PROCESSOR=x86_64 \
-DSHARED=ON \
make -j4
cd ..
# build x86_64
mkdir -p ${BuildPath}/temp_build_x86_64
cd temp_build_x86_64
cmake ../.. \
-DSHARED=ON \
make -j4
cd ..
# lipo combine 2 dylib
lipo -create ${BuildPath}/temp_build_aarch64/libdobby.dylib ${BuildPath}/temp_build_simulator_x86_64/libdobby.dylib -output ${BuildPath}/libdobby.dylib