Buck: d_binary()
Support Ukraine. Help Provide Humanitarian Aid to Ukraine.

d_binary()

This is liable to change in the future.

A d_binary() rule builds a native executable from the supplied set of D source files and dependencies.

Arguments

  • name (required) #

    The short name for this build target.

  • srcs (required) #

    The set of D source files to be compiled by this rule. Each element should be a string specifying a source file (e.g. 'foo/bar.d').

  • deps (defaults to []) #

    The set of dependencies of this rule. Each element should be a string specifying a d_library rule defined elsewhere (e.g. ':foo' or '//foo:bar').

  • linker_flags (required) #

    The list of flags to be passed to the linker. Each element should be a string specifying a linker flag (e.g. '--as-needed').

  • visibility (defaults to []) #

    List of build target patterns that identify the build rules that can include this rule as a dependency, for example, by listing it in their deps or exported_deps attributes. For more information, see visibility.

  • licenses (defaults to []) #

    Set of license files for this library. To get the list of license files for a given build rule and all of its dependencies, you can use buck query.

  • labels (defaults to []) #

    Set of arbitrary strings which allow you to annotate a build rule with tags that can be searched for over an entire dependency tree using buck query attrfilter().

Examples

# A rule that builds a D native executable from a single .d file
# and a library dependency.
d_binary(
  name='greet',
  srcs=[
    'greet.d',
  ],
  deps=[
    ':greeting',
  ],
)

d_library(
  name='greeting',
  srcs=[
    'greeting.d',
  ],
  deps=[
    ':join',
  ],
)

d_library(
  name='join',
  srcs=[
    'join.d',
  ],
)