mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-26 05:28:03 +03:00
build.sh add help [skip ci]
This commit is contained in:
parent
1d15946cff
commit
13e2db3423
25
build.sh
25
build.sh
@ -1,8 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
main()
|
||||
{
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
|
||||
if [[ "$*" =~ "--help" ]]; then
|
||||
help
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
n=0
|
||||
args=()
|
||||
for i in "$@"
|
||||
@ -25,8 +32,8 @@ done
|
||||
|
||||
case "$C" in
|
||||
("intel"|"icc") CC=icc CXX=icpc ;;
|
||||
("gcc") CC=gcc CXX=g++ ;;
|
||||
("clang") CC=clang CXX=clang++ ;;
|
||||
("gcc"|"g++") CC=gcc CXX=g++ ;;
|
||||
("clang|llvm") CC=clang CXX=clang++ ;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
@ -37,3 +44,17 @@ pushd build &> /dev/null
|
||||
CC=$CC CXX=$CXX cmake ${args[@]} ..
|
||||
make ${jobs}
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
help()
|
||||
{
|
||||
printf "Usage: ./build.sh <options>\n\n"
|
||||
printf " -c= | --compiler=<icc|gcc|clang> - Select preferred C/C++ compiler to build\n"
|
||||
printf " -j= | --jobs=<N> - Specifies the number of jobs (commands) to run simultaneously (For faster building)\n\n"
|
||||
}
|
||||
|
||||
# Initialize
|
||||
main $*
|
||||
|
||||
# Exit normally
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user