-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdetect_compiler.sh
30 lines (26 loc) · 1.04 KB
/
detect_compiler.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
# System-provided GCC variants
if command -v "riscv64-linux-gnu-g++-13" &> /dev/null; then
echo "* Building game scripts with system GCC/glibc compiler"
GCC_TRIPLE="riscv64-linux-gnu"
export CXX="ccache $GCC_TRIPLE-g++-13"
export CEXT="ON"
elif command -v "riscv64-linux-gnu-g++-12" &> /dev/null; then
echo "* Building game scripts with system GCC/glibc compiler"
GCC_TRIPLE="riscv64-linux-gnu"
export CXX="ccache $GCC_TRIPLE-g++-12"
export CEXT="ON"
elif command -v "riscv64-linux-gnu-g++-11" &> /dev/null; then
echo "* Building game scripts with system GCC/glibc compiler"
GCC_TRIPLE="riscv64-linux-gnu"
export CXX="ccache $GCC_TRIPLE-g++-11"
export CEXT="ON"
elif command -v "riscv64-linux-gnu-g++-10" &> /dev/null; then
echo "* Building game scripts with system GCC/glibc compiler"
GCC_TRIPLE="riscv64-linux-gnu"
export CXX="ccache $GCC_TRIPLE-g++-10"
export CEXT="ON"
else
echo "* Error: Could not detect RISC-V compiler. Install one from your package manager."
echo "* Example: sudo apt install g++-12-riscv64-linux-gnu"
exit 1
fi