query
On this page

mesonBool

lib.mesonBool

Docs pulled from | This Revision | about 13 hours ago


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

Inputs

condition
The condition to be made true or false
flag
The controlling flag of the condition

Type

mesonBool :: string -> bool -> string

Examples

lib.strings.mesonBool usage example

mesonBool "hardened" true
=> "-Dhardened=true"
mesonBool "static" false
=> "-Dstatic=false"
(lib.strings.mesonBool)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

mesonBool = condition: flag:
    assert (lib.isString condition);
    assert (lib.isBool flag);
    mesonOption condition (lib.boolToString flag);