ReGameDLL_CS/build.sh
s1lentq 271a49f8ca Add workflows/build.yml (Migrate to Github CI)
Add CMakeLists.txt build system
Update README.md
Minor fixes
2021-04-13 04:16:21 +07:00

40 lines
457 B
Bash
Executable File

#!/bin/bash
CC=gcc
CXX=g++
n=0
args=()
for i in "$@"
do
case $i in
-j=*|--jobs=*)
jobs="-j${i#*=}"
shift
;;
-c=*|--compiler=*)
C="${i#*=}"
shift
;;
*)
args[$n]="$i"
((++n))
;;
esac
done
case "$C" in
("intel"|"icc") CC=icc CXX=icpc ;;
("gcc"|"g++") CC=gcc CXX=g++ ;;
("clang|llvm") CC=clang CXX=clang++ ;;
*)
;;
esac
rm -rf build
mkdir build
pushd build &> /dev/null
CC=$CC CXX=$CXX cmake ${args[@]} ..
make ${jobs}
popd > /dev/null