-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·91 lines (78 loc) · 1.89 KB
/
setup.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
function build_module {
case "$1" in
lvgl)
cd $SCRIPT_DIR/build
rm -rf *
cmake -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIR/cmake/DevkitArm3DS-toolchain.cmake" $SCRIPT_DIR/lib/liblvgl
make -j6 install
mv install $SCRIPT_DIR/lib/build/lvgl
rm -rf *
cd $SCRIPT_DIR
;;
ncnn)
cd $SCRIPT_DIR/build
rm -rf *
cmake -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIR/cmake/DevkitArm3DS-toolchain.cmake" \
-DNCNN_SIMPLEOCV=ON \
-DNCNN_OPENMP=OFF \
-DNCNN_SIMPLEVK=OFF \
-DNCNN_VFPV4=OFF \
$SCRIPT_DIR/lib/ncnn
make -j6 install
mv install $SCRIPT_DIR/lib/build/ncnn_3ds
rm -rf *
cd $SCRIPT_DIR
;;
detkit)
cd $SCRIPT_DIR/build
rm -rf *
cmake -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIR/cmake/DevkitArm3DS-toolchain.cmake" \
-DNCNN_DIR="$SCRIPT_DIR/lib/build/ncnn_3ds/lib/cmake/ncnn" \
-DBUILD_C=ON \
$SCRIPT_DIR/lib/detector_c
make -j6 install
mv install $SCRIPT_DIR/lib/build/detector
rm -rf *
cd $SCRIPT_DIR
;;
3dsx)
cd $SCRIPT_DIR/build
rm -rf *
cmake $SCRIPT_DIR
make -j6 install
cp $SCRIPT_DIR/build/3dsx/* $SCRIPT_DIR/out
cd $SCRIPT_DIR
;;
cia)
cd $SCRIPT_DIR/build
rm -rf *
cmake -DBUILD_CIA=ON $SCRIPT_DIR
make -j6 install
cp $SCRIPT_DIR/build/cia/* $SCRIPT_DIR/out
;;
test)
cd $SCRIPT_DIR/build
rm -rf *
cmake -DBUILD_TEST=ON $SCRIPT_DIR
make -j6 install
cp $SCRIPT_DIR/build/3dsx/* $SCRIPT_DIR/out
;;
all)
./setup.sh lvgl ncnn detkit 3dsx cia
;;
clean)
rm -rf $SCRIPT_DIR/build
rm -rf $SCRIPT_DIR/out
rm -rf $SCRIPT_DIR/lib/build
;;
esac
}
mkdir -p $SCRIPT_DIR/build
mkdir -p $SCRIPT_DIR/out
mkdir -p $SCRIPT_DIR/lib/build
build_module "$1"
build_module "$2"
build_module "$3"
build_module "$4"
build_module "$5"