rename vopt_onoff to vopt_bool which returns -D<prop>=true|false

This makes it more generic and allows us to use it freely between
cmake and meson build styles.
This commit is contained in:
maxice8 2018-05-03 07:41:48 -03:00 committed by Enno Boland
parent 9a60b4f245
commit daf68c6d59
2 changed files with 7 additions and 7 deletions

View file

@ -29,12 +29,12 @@ vopt_conflict() {
fi
}
vopt_onoff() {
vopt_bool() {
local opt="$1" prop="$2"
if [ "$#" -lt "2" ]; then
msg_error "vopt_onoff <build_option> <property>: missing values\n"
msg_error "vopt_bool <build_option> <property>: missing values\n"
elif [ "$#" -gt "2" ]; then
msg_error "vopt_onoff $opt: $(($# - 2)) excess parameter(s)\n"
msg_error "vopt_bool $opt: $(($# - 2)) excess parameter(s)\n"
fi
vopt_if "$1" "-D${prop}=ON" "-D${prop}=OFF"
vopt_if "$1" "-D${prop}=true" "-D${prop}=false"
}