2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00
rehlds/build.sh

40 lines
424 B
Bash
Raw Normal View History

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