Skip to content

Commit

Permalink
meson.eclass: add meson_feature function
Browse files Browse the repository at this point in the history
This can be used to simplify controlling meson_options.txt entries
of type 'feature'.

Signed-off-by: Mart Raudsepp <[email protected]>
Signed-off-by: Matt Turner <[email protected]>
  • Loading branch information
leio authored and mattst88 committed Mar 17, 2019
1 parent 1237f22 commit eeb4c7a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions eclass/meson.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,19 @@ meson_use() {
usex "$1" "-D${2-$1}=true" "-D${2-$1}=false"
}

# @FUNCTION: meson_feature
# @USAGE: <USE flag> [option name]
# @DESCRIPTION:
# Given a USE flag and meson project option, outputs a string like:
#
# -Doption=enabled
# -Doption=disabled
#
# If the project option is unspecified, it defaults to the USE flag.
meson_feature() {
usex "$1" "-D${2-$1}=enabled" "-D${2-$1}=disabled"
}

# @FUNCTION: meson_src_configure
# @USAGE: [extra meson arguments]
# @DESCRIPTION:
Expand Down

0 comments on commit eeb4c7a

Please sign in to comment.