]> git.vomp.tv Git - vompclient.git/blob - build.sh
Enable clang compiler and mold linker when cross compiling
[vompclient.git] / build.sh
1 #!/bin/bash
2
3 NATIVE=no
4
5 if grep -q BCM2708 /proc/cpuinfo ; then
6   NATIVE=yes
7 elif grep -q BCM2709 /proc/cpuinfo ; then
8   NATIVE=yes
9 elif grep -q BCM2835 /proc/cpuinfo ; then
10   NATIVE=yes
11 else
12   NATIVE=no
13 fi
14
15 if [ $NATIVE == "no" ]; then
16   CROSS_COMPILE_INSERT=-DCMAKE_TOOLCHAIN_FILE=../src/CMakeToolChainRPi.txt
17   CROSS_COMPILE_J=-j8
18 fi
19
20 mkdir build
21 cmake $CROSS_COMPILE_INSERT -S src -B build && make -C build $CROSS_COMPILE_J