prebuilt_cxx_library_group()
This is liable to change in the future.
Aprebuilt_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.Arguments
name(required) #The short name for this build target.
exported_preprocessor_flags(defaults to[]) #Just as
preprocessor_flags, flags to use when preprocessing any of the above sources (which require preprocessing). However, unlikepreprocessor_flags, these preprocessor flags are also used by rules that transitively depend on this rule when preprocessing their own sources.static_link(defaults to[]) #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_libsparameter, and referenced via the the$(lib [index])macro in these args.static_libs(defaults to[]) #The paths to the libraries used when using the static link style. The
static_linkparameter should refer to these libs using their index number.static_pic_link(defaults to[]) #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_libsparameter, and referenced via the the$(lib [index])macro in these args.static_pic_libs(defaults to[]) #The paths to the libraries used when using the static link style. The
static_pic_linkparameter should refer to these libs using their index number.exported_deps(defaults to[]) #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(defaults to[]) #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. Seeexported_depsfor more information.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
depsorexported_depsattributes. 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 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',
},
)