File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 "
You can’t perform that action at this time.
0 commit comments