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_entry=" build"
3+ opt_flags=" -O3 -march=native -flto -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ftree-vectorize -fvisibility=hidden"
4+
5+ install_homebrew () {
6+ if ! command -v brew > /dev/null; then
7+ /bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) "
8+ fi
9+ }
10+
11+ setup_env () {
12+ eval " $( /opt/homebrew/bin/brew shellenv) "
13+ }
14+
15+ install_dependencies () {
16+ brew install qt@6 cmake ninja
17+
18+ export PATH=" /opt/homebrew/opt/qt@6/bin:$PATH "
19+ export QT_DIR=" /opt/homebrew/opt/qt@6"
20+ }
21+
22+ create_dir () {
23+ mkdir -p " $build_entry "
24+ cd " $build_entry " || exit
25+ }
26+
27+ cfg_and_build () {
28+ cmake \
29+ -DCMAKE_BUILD_TYPE=Release \
30+ -DCMAKE_CXX_COMPILER=clang++ \
31+ -DCMAKE_CXX_FLAGS=" $opt_flags " \
32+ -G " Ninja" \
33+ ..
34+
35+ ninja
36+ }
37+
38+ match_options () {
39+ case $1 in
40+ " install-base" ) install_homebrew ;;
41+ " install-libs" ) install_dependencies ;;
42+ " setup-build" ) create_build_dir ;;
43+ " build-release" ) cfg_and_build ;;
44+
45+ * ) echo " Missing arg: $1 " && exit 1 ;;
46+ esac
47+ }
48+
49+ match_options " $1 "
You can’t perform that action at this time.
0 commit comments