Vita3K-Android/gen-linux.sh
John Zimmermann c604e93769 gen-linux: use clang over default compiler
gcc (tested 8-10) has a sever performance penalty on gigantic switch
statements like in nids.cpp, clang is at least 10 times faster
2020-06-08 16:31:09 +02:00

30 lines
595 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
cmake_args=
CLANG=
command -v clang > /dev/null && CLANG=1
# CI uses pre-built Boost
if [[ -z "${CI}" ]]; then
# Create build dir
mkdir -p external/boost-build
cd external/boost
chmod +x tools/build/src/engine/build.sh
sh bootstrap.sh
# Build our Boost subset
./b2 --ignore-site-config -j$(nproc) --build-dir=../boost-build --stagedir=../boost-build stage
cd ../..
fi
if [ "$CLANG" ]; then
cmake_args="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
fi
# Generate project files
mkdir -p build-linux
cd build-linux
cmake .. -GNinja ${cmake_args}