Support for c2hs
Bazel

Support for c2hs


c2hs_toolchain

c2hs_toolchain(name, c2hs, **kwargs)

Declare a Haskell c2hs toolchain.

You need at least one of these declared somewhere in your BUILD files for the chs_library rule to work. Once declared, you then need to register the toolchain using register_toolchains in your WORKSPACE file (see example below).

Attributes

name

Name; Required

A unique name for this rule.

c2hs

Unknown; Required

**kwargs

Unknown; Optional

Examples

In a BUILD file:

c2hs_toolchain(
    name = "c2hs",
    c2hs = "@c2hs//:bin",
)

where @c2hs is an external repository defined in the WORKSPACE, e.g. using:

nixpkgs_package(
    name = "c2hs",
    attribute_path = "haskell.packages.ghc822.c2hs",
)

register_toolchains("//:c2hs")

c2hs_library

c2hs_library(name, deps, srcs, extra_args, src_strip_prefix, version)

Attributes

name

Name; Required

A unique name for this rule.

deps

List of labels; Optional; Default is []

srcs

List of labels; Optional; Default is []

extra_args

List of strings; Optional; Default is []

Extra arguments that should be passedto c2hs.

src_strip_prefix

String; Optional; Default is ''

Directory in which module hierarchy starts.

version

String; Optional; Default is ''

Executable version. If this is specified, CPP version macros will be generated for this build.