This is liable to change in the future.A
prebuilt_cxx_library()rule represents a set of native libraries and C/C++ header files and provides various flags to control how they are linked and exported.
The name of the rule.
Indicates if this library only consists of headers or not. If this is set to
True, Buck will not link this library into any library that depends on it.
The name of the library. If your library file was named
libmylib.a, this should be
mylib. This defaults to the
nameof the rule.
The directory the library
lib_namecan be found. This can use the
$(platform)macro to specify platform-dependent versions of the library.
If present, an un-anchored regex (in java.util.regex.Pattern syntax) that matches all platforms that this library supports. It will not be built for other platforms.
The set of header files that are made available for inclusion to the source files in the target and all targets that transitively depend on it. These should be specified as either a list of header files or a dictionary of header names to header files. The headers can be included with
#include <$HEADER_NAMESPACE/$HEADER_NAME>, where
$HEADER_NAMESPACEis the value of the target's
$HEADER_NAMEis the header name if specified, and the filename of the header file otherwise. Note that the header name can contain forward slashes (
header_namespacefor more information.
Platform specific header files. 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 either a list of header files or a dictionary of header names to header files that will be made available for inclusion to the source files in the target and all targets that transitively depend on it if the platform matches the regex. See
headersfor more information.
A path prefix when including headers of this target. Defaults to the path from the root of the repository to the directory where this target is defined. Can contain forward slashes (
/), but cannot start with one. See
headersfor more information.
preprocessor_flags, flags to use when preprocessing any of the above sources (which require preprocessing). However, unlike
preprocessor_flags, these preprocessor flags are also used by rules that transitively depend on this rule when preprocessing their own sources.
Platform specific exported preprocessor flags. 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 flags to use when preprocessing the source files in the target and all targets that transitively depend on it if the platform matches the regex. See
exported_preprocessor_flagsfor more information.
See preferred_linkage. If
true, the library will always be linked statically, even if the target that depends on it specifies
link_styleto be something other than
static. Note that this may still cause the library to be linked into its own shared library, if it happens to be the root of the linkable dependency tree (e.g. if a Python library directly depends on the library with
force_static=True). Also note this will cause duplicate symbols if multiple targets that depend on the library are linked together.
Dependencies that will also appear to belong to any rules that depend on this one. Currently, this only affects linking: exported dependencies will also be included in the link line of dependents of this rules, but normal dependencies will not.
A directory that headers can be included from. This can use the
$(platform)macro to specify platform-dependent versions of the directory.
List of build target patterns that identify the build rules that can include this rule in its
A prebuilt library containing only headers that other libraries may need.
prebuilt_cxx_library( name = 'stdutil', exported_headers = glob(['*.h']), )
A prebuilt library for multiple platforms. The directory tree for an Android and iOS build is laid out below it.
prebuilt_cxx_library( name = 'mylib', lib_dir = 'lib/$(platform)', exported_headers = [ 'mylib.h', ], )
lib/ android-arm/ libmylib.a android-armv7/ libmylib.a android-x86/ libmylib.a iphonesimulator-x86_64/ libmylib.a iphoneos-i386/ libmylib.a iphoneos-arm64/ libmylib.a