query
On this page

enableFeature

lib.strings.enableFeature

Docs pulled from | This Revision | 8 minutes ago


Create an --{enable,disable}- string that can be passed to standard GNU Autoconf scripts.

Inputs

flag
1. Function argument
feature
2. Function argument

Type

enableFeature :: bool -> string -> string

Examples

lib.strings.enableFeature usage example

enableFeature true "shared"
=> "--enable-shared"
enableFeature false "shared"
=> "--disable-shared"

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

enableFeature = flag: feature:
    assert lib.isBool flag;
    assert lib.isString feature; # e.g. passing openssl instead of "openssl"
    "--${if flag then "enable" else "disable"}-${feature}";