forked from BoomingTech/Piccolo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_linux.sh
39 lines (32 loc) · 1.08 KB
/
build_linux.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
#!/bin/bash
if test \( $# -ne 1 \);
then
echo "Usage: build.sh arch config"
echo ""
echo "Configs:"
echo " debug - build with the debug configuration"
echo " release - build with the release configuration"
echo ""
exit 1
fi
if test \( \( -n "$1" \) -a \( "$1" = "debug" \) \);then
CMAKE_ARG_BUILD_TYPE_CONFIG="-DCMAKE_BUILD_TYPE=Debug"
elif test \( \( -n "$1" \) -a \( "$1" = "release" \) \);then
CMAKE_ARG_BUILD_TYPE_CONFIG="-DCMAKE_BUILD_TYPE=Release"
else
echo "The config \"$1\" is not supported!"
echo ""
echo "Configs:"
echo " debug - build with the debug configuration"
echo " release - build with the release configuration"
echo ""
exit 1
fi
MY_DIR="$(cd "$(dirname "$0")" 1>/dev/null 2>/dev/null && pwd)"
cd "${MY_DIR}"
mkdir -p "engine/shader/generated/spv"
# export PATH=/home/boomingtech/Documents/cmake-3.22.3-linux-x86_64/bin${PATH:+:${PATH}}
export CC=clang
export CXX=clang++
cmake -S engine -B build "${CMAKE_ARG_BUILD_TYPE_CONFIG}" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build "${MY_DIR}/build"