meson.eclass: add meson_use function

This commit is contained in:
Mike Gilbert
2017-12-11 14:14:06 -05:00
parent 4682eef981
commit b7ad7de7e4

View File

@@ -137,6 +137,19 @@ _meson_create_cross_file() {
EOF
}
# @FUNCTION: meson_use
# @USAGE: <USE flag> [option name]
# @DESCRIPTION:
# Given a USE flag and meson project option, outputs a string like:
#
# -Doption=true
# -Doption=false
#
# If the project option is unspecified, it defaults to the USE flag.
meson_use() {
usex "$1" "-D${2-$1}=true" "-D${2-$1}=false"
}
# @FUNCTION: meson_src_configure
# @DESCRIPTION:
# This is the meson_src_configure function.