Skip to content

Commit 7ddca08

Browse files
Add shell script CI for Linux build
1 parent 4918689 commit 7ddca08

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

scripts/ci_linux.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
build_dir="../build"
3+
release_flags="-DCMAKE_BUILD_TYPE=Release"
4+
opt_flags="-O3 -march=native -flto -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ftree-vectorize -fvisibility=hidden"
5+
clang="-DCMAKE_CXX_FLAGS=clang++"
6+
7+
create_build_dir() {
8+
mkdir $build_dir
9+
}
10+
11+
install_base() {
12+
sudo apt install -y \
13+
clang \
14+
qt6-base-dev \
15+
ninja-build \
16+
cmake \
17+
build-essential
18+
}
19+
20+
build_zclipboard() {
21+
cd "$build_dir" || exit
22+
23+
cmake -G "Ninja" \
24+
$clang \
25+
-DCMAKE_CXX_FLAGS="$opt_flags" \
26+
$release_flags \
27+
..
28+
}
29+
30+
match_options() {
31+
case "$1" in
32+
"install-base") install_base ;;
33+
34+
"mkdir-build") create_build_dir ;;
35+
"release-build") build_zclipboard ;;
36+
*)
37+
echo "Invalid args $1"
38+
exit 1
39+
;;
40+
41+
esac
42+
}
43+
44+
match_options "$1"

0 commit comments

Comments
 (0)