1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-07-03 11:53:41 +02:00

build.sh: Adding pkg-type option.

This commit is contained in:
Henrik Hautakoski 2020-03-14 21:05:02 +01:00
parent f601824e02
commit 006fb94786

View file

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
function usage() { function usage() {
echo "Usage: ${0##*/} [ -h|--help ] [ -t|--type Debug|Release|RelWithDebInfo|MinSizeRel ] [ --disable-threads ] [ --force-ansi ]" echo "Usage: ${0##*/} [ -h|--help ] [ -t|--type Debug|Release|RelWithDebInfo|MinSizeRel ] [--pkg-type deb|zip|tgz] [ --disable-threads ] [ --force-ansi ]"
exit 1 exit 1
} }
options=$(getopt -n "${0##*/}" -o "lht:" -l "help,type:,disable-threads,force-ansi" -- "$@") options=$(getopt -n "${0##*/}" -o "lht:" -l "help,type:,pkg-type:,disable-threads,force-ansi" -- "$@")
[ $? -eq 0 ] || usage [ $? -eq 0 ] || usage
@ -24,6 +24,15 @@ while true; do
} }
ARGS="${ARGS} -DCMAKE_BUILD_TYPE=${1}" ARGS="${ARGS} -DCMAKE_BUILD_TYPE=${1}"
;; ;;
--pkg-type)
shift
[[ ! "$1" =~ ^(deb|zip|tgz)$ ]] && {
echo "Incorrect package type '$1' provided"
usage
}
TARGET="package"
ARGS="${ARGS} -DCPACK_GENERATOR=${1^^}"
;;
--disable-threads) --disable-threads)
ARGS="${ARGS} -DUSE_THREADS=OFF" ;; ARGS="${ARGS} -DUSE_THREADS=OFF" ;;
--force-ansi) --force-ansi)
@ -41,5 +50,5 @@ done
cmake -B build $ARGS . cmake -B build $ARGS .
if [ ${ONLY_CONFIG} -eq 0 ]; then if [ ${ONLY_CONFIG} -eq 0 ]; then
cmake --build build --clean-first --target cmake --build build --clean-first --target ${TARGET}
fi fi