mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-10 05:33:51 -04:00
meson-pgo: improved argument validation
This commit is contained in:
parent
a3b6ecf3b2
commit
ac9b3025d8
1 changed files with 19 additions and 10 deletions
29
meson-pgo.sh
29
meson-pgo.sh
|
|
@ -2,25 +2,34 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
mode=${1}; shift
|
usage_and_die() {
|
||||||
source_dir=$(realpath "${1}"); shift
|
echo "Usage: ${0} none|partial|full|full-headless-sway|[auto] <source-dir> <build-dir>"
|
||||||
build_dir=$(realpath ${1}); shift
|
|
||||||
|
|
||||||
if [ -d ${build_dir} ]; then
|
|
||||||
echo "${build_dir}: build directory already exists"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
}
|
||||||
|
|
||||||
|
[ ${#} -ge 3 ] || usage_and_die
|
||||||
|
|
||||||
|
mode=${1}
|
||||||
|
source_dir=$(realpath "${2}")
|
||||||
|
build_dir=$(realpath "${3}")
|
||||||
|
shift 3
|
||||||
|
|
||||||
case ${mode} in
|
case ${mode} in
|
||||||
none|auto|partial|full|full-headless-sway)
|
none|auto|partial|full|full-headless-sway)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "${mode}: invalid PGO mode (must be one of 'auto', 'partial' or 'full')"
|
usage_and_die
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# meson will complain if source dir is invalid
|
||||||
|
|
||||||
|
if [ -d "${build_dir}" ]; then
|
||||||
|
echo "${build_dir}: build directory already exists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
compiler=other
|
compiler=other
|
||||||
do_pgo=no
|
do_pgo=no
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue