-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
43 lines (37 loc) · 1.11 KB
/
install.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
#!/bin/bash
# Ninja as default generator,
# But if Ninja is not installed, just select cmake
build_system="Ninja"
read -rp "Build from source? (y/n): " build_from_source
read -rp "Use CMake or Ninja as the build system? (cmake/ninja): " selected_build_system
if [[ $selected_build_system == "cmake" ]]; then
build_system="Unix Makefiles"
else
build_system="Ninja"
fi
if [[ $build_from_source == [Yy] ]]; then
echo "Building from ground up using $build_system."
if [[ $build_system == "Ninja" ]]; then
rm -rf ninja-build
cmake -S . -B ninja-build -DCMAKE_BUILD_TYPE=Release -G"$build_system"
cd ninja-build || exit
ninja
else
rm -rf build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -G"$build_system"
cd build || exit
make
fi
else
echo "Building only WalnutApp"
if [[ $build_system == "Ninja" ]]; then
cmake --build ./ninja-build --target WalnutApp
cd ninja-build || exit
ninja
else
cmake --build ./build --target WalnutApp
cd build || exit
make
fi
fi
./WalnutApp/WalnutApp