add help info to mingw build script

This commit is contained in:
Roy Qu 2024-03-29 09:03:34 +08:00
parent 6b5af409a6
commit 1872241cb1
1 changed files with 25 additions and 18 deletions

View File

@ -2,16 +2,19 @@
set -euxo pipefail set -euxo pipefail
# Usage: function fn_print_help() {
# packages/msys/build-mingw.sh [-m|--msystem <MSYSTEM>] [-c|--clean] [-nd|--no-deps] [-t|--target-dir <dir>] echo " Usage:
# Options: packages/msys/build-mingw.sh [-m|--msystem <MSYSTEM>] [-c|--clean] [-nd|--no-deps] [-t|--target-dir <dir>]
# -m, --msystem <MSYSTEM> switch to other MSYS2 environment Options:
# (MINGW32, MINGW64, UCRT64, CLANG32, CLANG64, CLANGARM64) -h, --help Display this information.
# MUST be used before other options -m, --msystem <MSYSTEM> Switch to other MSYS2 environment.
# -c, --clean clean build and package directories (MINGW32, MINGW64, UCRT64, CLANG32, CLANG64, CLANGARM64)
# -nd, --no-deps skip dependency check MUST be used before other options.
# -t, --target-dir <dir> set target directory for the packages -c, --clean Clean build and package directories.
--mingw Build mingw integrated installer.
-nd, --no-deps Skip dependency check.
-t, --target-dir <dir> Set target directory for the packages."
}
source version.inc source version.inc
[[ -n "${APP_VERSION_SUFFIX}" ]] && APP_VERSION="${APP_VERSION}${APP_VERSION_SUFFIX}" [[ -n "${APP_VERSION_SUFFIX}" ]] && APP_VERSION="${APP_VERSION}${APP_VERSION_SUFFIX}"
@ -65,18 +68,22 @@ COMPILER_MINGW64=0
TARGET_DIR="$(pwd)/dist" TARGET_DIR="$(pwd)/dist"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
-h|--help)
fn_print_help
exit 0
;;
-c|--clean) -c|--clean)
CLEAN=1 CLEAN=1
shift shift
;; ;;
--mingw32) --mingw)
compilers+=("mingw32") if [[ "${NSIS_ARCH}" == "x86" ]]; then
COMPILER_MINGW32=1 compilers+=("mingw32")
shift COMPILER_MINGW32=1
;; else
--mingw64) compilers+=("mingw64")
compilers+=("mingw64") COMPILER_MINGW64=1
COMPILER_MINGW64=1 fi
shift shift
;; ;;
-nd|--no-deps) -nd|--no-deps)