query
On this page

mesonEnable

lib.mesonEnable

Docs pulled from | This Revision | 14 minutes ago


Create a -D={enabled,disabled} string that can be passed to typical Meson invocations.

Inputs

feature
The feature to be enabled or disabled
flag
The controlling flag

Type

mesonEnable :: string -> bool -> string

Examples

lib.strings.mesonEnable usage example

mesonEnable "docs" true
=> "-Ddocs=enabled"
mesonEnable "savage" false
=> "-Dsavage=disabled"
(lib.strings.mesonEnable)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

mesonEnable = feature: flag:
    assert (lib.isString feature);
    assert (lib.isBool flag);
    mesonOption feature (if flag then "enabled" else "disabled");