forked from Tencent/ncnn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·74 lines (68 loc) · 2.81 KB
/
package.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
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/bash
NAME=ncnn
##### package android lib
ANDROIDPKGNAME=${NAME}-android-lib
rm -rf $ANDROIDPKGNAME
mkdir -p $ANDROIDPKGNAME
mkdir -p $ANDROIDPKGNAME/armeabi-v7a
mkdir -p $ANDROIDPKGNAME/arm64-v8a
mkdir -p $ANDROIDPKGNAME/x86
mkdir -p $ANDROIDPKGNAME/x86_64
mkdir -p $ANDROIDPKGNAME/include
cp build-android-armv7/install/lib/lib${NAME}.a $ANDROIDPKGNAME/armeabi-v7a/
cp build-android-aarch64/install/lib/lib${NAME}.a $ANDROIDPKGNAME/arm64-v8a/
cp build-android-x86/install/lib/lib${NAME}.a $ANDROIDPKGNAME/x86/
cp build-android-x86_64/install/lib/lib${NAME}.a $ANDROIDPKGNAME/x86_64/
cp -r build-android-aarch64/install/include/* $ANDROIDPKGNAME/include/
rm -f $ANDROIDPKGNAME.zip
zip -9 -r $ANDROIDPKGNAME.zip $ANDROIDPKGNAME
##### package ios framework
IOSPKGNAME=${NAME}.framework
rm -rf $IOSPKGNAME
mkdir -p $IOSPKGNAME/Versions/A/Headers
mkdir -p $IOSPKGNAME/Versions/A/Resources
ln -s A $IOSPKGNAME/Versions/Current
ln -s Versions/Current/Headers $IOSPKGNAME/Headers
ln -s Versions/Current/Resources $IOSPKGNAME/Resources
ln -s Versions/Current/${NAME} $IOSPKGNAME/${NAME}
lipo -create \
build-ios/install/lib/lib${NAME}.a \
build-ios-sim/install/lib/lib${NAME}.a \
-o $IOSPKGNAME/Versions/A/${NAME}
cp -r build-ios/install/include/* $IOSPKGNAME/Versions/A/Headers/
cp Info.plist ${IOSPKGNAME}/Versions/A/Resources/
rm -f $IOSPKGNAME.zip
zip -9 -y -r $IOSPKGNAME.zip $IOSPKGNAME
##### package android lib vulkan
ANDROIDPKGNAME=${NAME}-android-vulkan-lib
rm -rf $ANDROIDPKGNAME
mkdir -p $ANDROIDPKGNAME
mkdir -p $ANDROIDPKGNAME/armeabi-v7a
mkdir -p $ANDROIDPKGNAME/arm64-v8a
mkdir -p $ANDROIDPKGNAME/x86
mkdir -p $ANDROIDPKGNAME/x86_64
mkdir -p $ANDROIDPKGNAME/include
cp build-android-armv7-vulkan/install/lib/lib${NAME}.a $ANDROIDPKGNAME/armeabi-v7a/
cp build-android-aarch64-vulkan/install/lib/lib${NAME}.a $ANDROIDPKGNAME/arm64-v8a/
cp build-android-x86-vulkan/install/lib/lib${NAME}.a $ANDROIDPKGNAME/x86/
cp build-android-x86_64-vulkan/install/lib/lib${NAME}.a $ANDROIDPKGNAME/x86_64/
cp -r build-android-aarch64-vulkan/install/include/* $ANDROIDPKGNAME/include/
rm -f $ANDROIDPKGNAME.zip
zip -9 -r $ANDROIDPKGNAME.zip $ANDROIDPKGNAME
##### package ios framework vulkan
IOSPKGNAME=${NAME}-vulkan.framework
rm -rf $IOSPKGNAME
mkdir -p $IOSPKGNAME/Versions/A/Headers
mkdir -p $IOSPKGNAME/Versions/A/Resources
ln -s A $IOSPKGNAME/Versions/Current
ln -s Versions/Current/Headers $IOSPKGNAME/Headers
ln -s Versions/Current/Resources $IOSPKGNAME/Resources
ln -s Versions/Current/${NAME} $IOSPKGNAME/${NAME}
lipo -create \
build-ios-vulkan/install/lib/lib${NAME}.a \
build-ios-sim-vulkan/install/lib/lib${NAME}.a \
-o $IOSPKGNAME/Versions/A/${NAME}
cp -r build-ios-vulkan/install/include/* $IOSPKGNAME/Versions/A/Headers/
cp Info.plist ${IOSPKGNAME}/Versions/A/Resources/
rm -f $IOSPKGNAME.zip
zip -9 -y -r $IOSPKGNAME.zip $IOSPKGNAME