Skip to main content

prebuilt_cxx_library_group

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 = ...,
contacts: list[str] = ...,
default_host_platform: None | str = ...,
deps: list[str] = ...,
exported_deps: list[str] = ...,
exported_platform_deps: list[(str, list[str])] = ...,
exported_preprocessor_flags: list[str] = ...,
import_libs: dict[str, str] = ...,
include_dirs: list[str] = ...,
include_in_android_merge_map_output: bool = ...,
labels: list[str] = ...,
licenses: list[str] = ...,
provided_shared_libs: dict[str, str] = ...,
shared_libs: dict[str, str] = ...,
shared_link: list[str] = ...,
static_libs: list[str] = ...,
static_link: list[str] = ...,
static_pic_libs: list[str] = ...,
static_pic_link: list[str] = ...,
supported_platforms_regex: None | str = ...,
supports_shared_library_interface: bool = ...,
version: None | str = ...,
) -> None

A prebuilt_cxx_library_group() rule represents a group of native libraries which should be handled together in a single rule, perhaps using special link-line construction.

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
  • exported_deps: Dependencies that will also appear to belong to any rules that depend on this one. This has two effects: * Exported dependencies will also be included in the link line of dependents of this rules, but normal dependencies will not. * When reexport_all_header_dependencies = False, only exported headers of the rules specified here are re-exported.
  • exported_platform_deps: Platform specific dependencies that will also appear to belong to any rules that depend on this one. These should be specified as a list of pairs where the first element is an un-anchored regex (in java.util.regex.Pattern syntax) against which the platform name is matched, and the second element is a list of external dependencies (same format as exported_deps) that are exported if the platform matches the regex. See exported_deps for more information.
  • provided_shared_libs: The map of system-provided shared library names to paths used when using the shared link style. The shared_link parameter should refer to these libs using their library name.
  • shared_libs: The map of shared library names to paths used when using the shared link style. The shared_link parameter should refer to these libs using their library name.
  • shared_link: The arguments to use when linking this library group using the shared link style. The actual paths to libraries should be listed in the shared_libs parameter, and referenced via the the $(lib [name]) macro (or the $(rel-lib [name]) macro, when the shared library should be linked using the -L[dir] -l[name] style) in these args.
  • static_libs: The paths to the libraries used when using the static link style. The static_link parameter should refer to these libs using their index number.
  • static_link: The arguments to use when linking this library group using the static link style. The actual paths to libraries should be listed in the static_libs parameter, and referenced via the the $(lib [index]) macro in these args.
  • static_pic_libs: The paths to the libraries used when using the static link style. The static_pic_link parameter should refer to these libs using their index number.
  • static_pic_link: The arguments to use when linking this library group using the static-pic link style. The actual paths to libraries should be listed in the static_pic_libs parameter, and referenced via the the $(lib [index]) macro in these args.
  • version: A string denoting a meaningful version of this rule that is optionally passed to the linker as extra metadata.

Details

Examples:

A prebuilt library group wrapping two libraries that must be linked together.


prebuilt_cxx_library_group(
name = 'util',
static_link = [
'-Wl,--start-group',
'$(lib 0)',
'$(lib 1)',
'-Wl,--end-group',
],
static_libs = [
'lib/liba.a',
'lib/libb.a',
],
static_pic_link = [
'-Wl,--start-group',
'$(lib 0)',
'$(lib 1)',
'-Wl,--end-group',
],
static_libs = [
'lib/liba_pic.a',
'lib/libb_pic.a',
],
shared_link = [
'$(rel-lib liba.so)',
'$(rel-lib libb.so)',
],
shared_libs = {
'liba.so': 'lib/liba.so',
},
provided_shared_libs = {
'libb.so': 'lib/libb.so',
},
)