forked from id-Software/Quake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-native.sh
More file actions
executable file
·66 lines (50 loc) · 1.25 KB
/
build-native.sh
File metadata and controls
executable file
·66 lines (50 loc) · 1.25 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
set -e
if ! command -v git >/dev/null 2>&1; then
echo "error: git not found; have you installed it?"
exit 1
fi
if ! command -v cmake >/dev/null 2>&1; then
echo "error: cmake not found; have you installed it?"
exit 1
fi
if ! command -v make >/dev/null 2>&1; then
echo "error: make not found; have you installed it?"
exit 1
fi
pushd WinQuake >/dev/null
if command -v fteqcc >/dev/null 2>&1; then
pushd id1/progs/src >/dev/null
fteqcc -O1
popd >/dev/null
fi
if [[ "${CLEAN}" == "1" ]]; then
rm -fr build-native 2>&1 || true
fi
mkdir -p build-native
cd build-native
if command -v clang-20 >/dev/null 2>&1; then
CC="$(which clang-20)"
else
CC="$(which clang)"
fi
if command -v clang++-20 >/dev/null 2>&1; then
CXX="$(which clang++-20)"
else
CXX="$(which clang++)"
fi
export CC
export CXX
if [[ "${DEBUG}" == "1" ]]; then
ASAN_OPTIONS=detect_leaks=1 cmake -Wno-dev -DCMAKE_BUILD_TYPE=Debug -B . -S ../
else
cmake -Wno-dev -DCMAKE_BUILD_TYPE=Release -B . -S ../
fi
make
echo ""
find ./ -maxdepth 1 -type f -name 'Quake' || true
find ./ -maxdepth 1 -type f -name '*.dylib' || true
find ./ -maxdepth 1 -type f -name '*.so' || true
find ./ -maxdepth 1 -type f -name '*.js' || true
find ./ -maxdepth 1 -type f -name '*.html' || true
popd >/dev/null