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

40 lines
449 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="-j${i#*=}"
2021-04-08 01:04:42 +03:00
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 &> /dev/null
2021-04-08 01:04:42 +03:00
CC=$CC CXX=$CXX cmake ${args[@]} ..
make ${jobs}
popd > /dev/null