-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathlinux_build.sh
110 lines (87 loc) · 3.82 KB
/
linux_build.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
SRC_ROOT_DIR=$(realpath $(dirname "$0"))
# 编译zlib(.a文件有改名)
cmake -S "$SRC_ROOT_DIR/duilib/third_party/zlib/" -B "$SRC_ROOT_DIR/build_temp/zlib" -DZLIB_BUILD_EXAMPLES=OFF
cd "$SRC_ROOT_DIR/build_temp/zlib"
make
cd "$SRC_ROOT_DIR/"
rm -f "$SRC_ROOT_DIR/libs/libduilib-zlib.a"
cp "$SRC_ROOT_DIR/build_temp/zlib/libz.a" "$SRC_ROOT_DIR/libs/libduilib-zlib.a"
#恢复zconf.h文件
mv "$SRC_ROOT_DIR/duilib/third_party/zlib/zconf.h.included" "$SRC_ROOT_DIR/duilib/third_party/zlib/zconf.h"
#编译libpng(.a文件有改名)
cmake -S "$SRC_ROOT_DIR/duilib/third_party/libpng/" -B "$SRC_ROOT_DIR/build_temp/libpng" -DPNG_TESTS=OFF -DPNG_SHARED=OFF -DPNG_TOOLS=OFF -DZLIB_ROOT="$SRC_ROOT_DIR/duilib/third_party/zlib/"
cd "$SRC_ROOT_DIR/build_temp/libpng"
make
cd "$SRC_ROOT_DIR/"
rm -f "$SRC_ROOT_DIR/libs/libduilib-png.a"
cp "$SRC_ROOT_DIR/build_temp/libpng/libpng16.a" "$SRC_ROOT_DIR/libs/libduilib-png.a"
#编译cximage
rm -f "$SRC_ROOT_DIR/libs/libduilib-cximage.a"
cmake -S "$SRC_ROOT_DIR/duilib/third_party/cximage/" -B "$SRC_ROOT_DIR/build_temp/cximage"
cd "$SRC_ROOT_DIR/build_temp/cximage"
make
cd "$SRC_ROOT_DIR/"
#编译libwebp
rm -f "$SRC_ROOT_DIR/libs/libduilib-webp.a"
cmake -S "$SRC_ROOT_DIR/duilib/third_party/libwebp/" -B "$SRC_ROOT_DIR/build_temp/libwebp"
cd "$SRC_ROOT_DIR/build_temp/libwebp"
make
cd "$SRC_ROOT_DIR/"
#编译duilib
rm -f "$SRC_ROOT_DIR/libs/libduilib.a"
cmake -S "$SRC_ROOT_DIR/duilib/" -B "$SRC_ROOT_DIR/build_temp/duilib" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/duilib"
make -j 4
cd "$SRC_ROOT_DIR/"
#编译examples下的各个程序
cmake -S "$SRC_ROOT_DIR/examples/basic/" -B "$SRC_ROOT_DIR/build_temp/basic" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/basic"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/ColorPicker/" -B "$SRC_ROOT_DIR/build_temp/ColorPicker" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/ColorPicker"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/controls/" -B "$SRC_ROOT_DIR/build_temp/controls" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/controls"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/DpiAware/" -B "$SRC_ROOT_DIR/build_temp/DpiAware" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/DpiAware"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/layouts/" -B "$SRC_ROOT_DIR/build_temp/layouts" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/layouts"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/ListBox/" -B "$SRC_ROOT_DIR/build_temp/ListBox" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/ListBox"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/ListCtrl/" -B "$SRC_ROOT_DIR/build_temp/ListCtrl" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/ListCtrl"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/move_control/" -B "$SRC_ROOT_DIR/build_temp/move_control" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/move_control"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/MultiLang/" -B "$SRC_ROOT_DIR/build_temp/MultiLang" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/MultiLang"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/render/" -B "$SRC_ROOT_DIR/build_temp/render" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/render"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/RichEdit/" -B "$SRC_ROOT_DIR/build_temp/RichEdit" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/RichEdit"
make clean; make
cd "$SRC_ROOT_DIR/"
cmake -S "$SRC_ROOT_DIR/examples/VirtualListBox/" -B "$SRC_ROOT_DIR/build_temp/VirtualListBox" -DCMAKE_BUILD_TYPE=Debug
cd "$SRC_ROOT_DIR/build_temp/VirtualListBox"
make clean; make
cd "$SRC_ROOT_DIR/"
#清理临时目录
#rm -rf "$SRC_ROOT_DIR/build_temp/"