Skip to main content

llvm_link_bitcode

name

def name(
*,
name: str,
default_target_platform: None | str = ...,
target_compatible_with: list[str] = ...,
compatible_with: list[str] = ...,
exec_compatible_with: list[str] = ...,
visibility: list[str] = ...,
within_view: list[str] = ...,
metadata: OpaqueMetadata = ...,
tests: list[str] = ...,
modifiers: OpaqueMetadata = ...,
_apple_platforms: dict[str, str] = ...,
_cxx_toolchain: str = ...,
deps: list[str] = ...,
deps_query: None | str = ...,
srcs: list[str | (str, list[str])] = ...,
) -> None

A llvm_link_bitcode() rule builds a LLVM bitcode object from a given set LLVM bitcode inputs.

Parameters

  • name: name of the target

  • default_target_platform: specifies the default target platform, used when no platforms are specified on the command line

  • target_compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with a configuration

  • compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with a configuration

  • exec_compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with an execution platform

  • visibility: a list of visibility patterns restricting what targets can depend on this one

  • within_view: a list of visibility patterns restricting what this target can depend on

  • metadata: a key-value map of metadata associated with this target

  • tests: a list of targets that provide tests for this one

  • modifiers: an array of modifiers associated with this target

  • deps_query: Status: experimental/unstable. The deps query takes a query string that accepts the following query functions, and appends the output of the query to the declared deps:

    • attrfilter
    • deps
    • except
    • intersect
    • filter
    • kind
    • set
    • union

    Some example queries:

      "filter({name_regex}, deps('//foo:foo'))".format(name_regex='//.*')
    "attrfilter(annotation_processors, com.foo.Processor, deps('//foo:foo'))"
    "deps('//foo:foo', 1)"
  • srcs: The set of C, C++, Objective-C, Objective-C++, or assembly source files to be preprocessed, compiled, and assembled by this rule. We determine which stages to run on each input source based on its file extension. See the GCC documentation for more detail on how file extensions are interpreted. Each element can be either a string specifying a source file (e.g. '') or a tuple of a string specifying a source file and a list of compilation flags (e.g. ('', ['-Wall', '-Werror']) ). In the latter case the specified flags will be used in addition to the rule's other flags when preprocessing and compiling that file (if applicable).

Details

Examples:


# A rule that builds and runs C/C++ test using gtest.
llvm_link_bitcode(
name = 'echo_test',
srcs = [
'echo_test.o', // Where this is a LLVM bitcode object.
'echo_other.o', // And this is another LLVM bitcode object.
],
)