Rules
objc_import
View rule sourceobjc_import(name, deps, hdrs, alwayslink, archives, aspect_hints, compatible_with, deprecation, exec_compatible_with, exec_group_compatible_with, exec_properties, features, includes, package_metadata, restricted_to, sdk_dylibs, sdk_frameworks, sdk_includes, tags, target_compatible_with, testonly, textual_hdrs, toolchains, visibility, weak_sdk_frameworks)
This rule encapsulates an already-compiled static library in the form of an
.a file. It also allows exporting headers and resources using the same
attributes supported by objc_library.
Arguments
| Attributes | |
|---|---|
| name | Name; required A unique name for this target. | 
| deps | List of labels; default is  | 
| hdrs | List of labels; default is  These headers describe the public interface for the library and will be made available for inclusion by sources in this rule or in dependent rules. Headers not meant to be included by a client of this library should be listed in the srcs attribute instead. These will be compiled separately from the source if modules are enabled. | 
| alwayslink | Boolean; default is  srcsandnon_arc_srcs, even if some contain no
symbols referenced by the binary.
This is useful if your code isn't explicitly called by code in
the binary, e.g., if your code registers to receive some callback
provided by some service. | 
| archives | List of labels; requiredThe list of .afiles provided to Objective-C targets that
depend on this target. | 
| includes | List of strings; default is  #include/#importsearch paths to add to this target
and all depending targets.
This is to support third party and open-sourced libraries that do not
specify the entire workspace path in their#import/#includestatements.
The paths are interpreted relative to the package directory, and the
genfiles and bin roots (e.g.  Unlike COPTS, these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-iquote" flags to COPTS instead. | 
| sdk_dylibs | List of strings; default is  | 
| sdk_frameworks | List of strings; default is  When linking a top level Apple binary, all SDK frameworks listed in that binary's transitive dependency graph are linked. | 
| sdk_includes | List of strings; default is  #include/#importsearch paths to add to this target
and all depending targets, where each path is relative to$(SDKROOT)/usr/include. | 
| textual_hdrs | List of labels; default is  | 
| weak_sdk_frameworks | List of strings; default is  | 
objc_library
View rule sourceobjc_library(name, deps, srcs, data, hdrs, alwayslink, aspect_hints, compatible_with, conlyopts, copts, cxxopts, defines, deprecation, enable_modules, exec_compatible_with, exec_group_compatible_with, exec_properties, features, implementation_deps, includes, linkopts, module_map, module_name, non_arc_srcs, package_metadata, pch, restricted_to, sdk_dylibs, sdk_frameworks, sdk_includes, stamp, tags, target_compatible_with, testonly, textual_hdrs, toolchains, visibility, weak_sdk_frameworks)
This rule produces a static library from the given Objective-C source files.
Arguments
| Attributes | |
|---|---|
| name | Name; required A unique name for this target. | 
| deps | List of labels; default is  | 
| srcs | List of labels; default is  | 
| hdrs | List of labels; default is  These headers describe the public interface for the library and will be made available for inclusion by sources in this rule or in dependent rules. Headers not meant to be included by a client of this library should be listed in the srcs attribute instead. These will be compiled separately from the source if modules are enabled. | 
| alwayslink | Boolean; default is  srcsandnon_arc_srcs, even if some contain no
symbols referenced by the binary.
This is useful if your code isn't explicitly called by code in
the binary, e.g., if your code registers to receive some callback
provided by some service. | 
| conlyopts | List of strings; default is  Note that for the generated Xcode project, directory paths specified using "-I" flags in copts are parsed out, prepended with "$(WORKSPACE_ROOT)/" if they are relative paths, and added to the header search paths for the associated Xcode target. | 
| copts | List of strings; default is  Note that for the generated Xcode project, directory paths specified using "-I" flags in copts are parsed out, prepended with "$(WORKSPACE_ROOT)/" if they are relative paths, and added to the header search paths for the associated Xcode target. | 
| cxxopts | List of strings; default is  Note that for the generated Xcode project, directory paths specified using "-I" flags in copts are parsed out, prepended with "$(WORKSPACE_ROOT)/" if they are relative paths, and added to the header search paths for the associated Xcode target. | 
| defines | List of strings; default is  -Dflags to pass to the compiler. They should be in
the formKEY=VALUEor simplyKEYand are
passed not only to the compiler for this target (ascoptsare) but also to allobjc_dependers of this target.
Subject to "Make variable" substitution and
Bourne shell tokenization. | 
| enable_modules | Boolean; default is  | 
| implementation_deps | List of labels; default is  deps, the headers and include paths of these libraries (and all their
transitive deps) are only used for compilation of this library, and not libraries that
depend on it. Libraries specified withimplementation_depsare still linked
in binary targets that depend on this library. | 
| includes | List of strings; default is  #include/#importsearch paths to add to this target
and all depending targets.
This is to support third party and open-sourced libraries that do not
specify the entire workspace path in their#import/#includestatements.
The paths are interpreted relative to the package directory, and the
genfiles and bin roots (e.g.  Unlike COPTS, these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-iquote" flags to COPTS instead. | 
| linkopts | List of strings; default is  | 
| module_map | Label; default is  | 
| module_name | String; default is  | 
| non_arc_srcs | List of labels; default is  | 
| pch | Label; default is  | 
| sdk_dylibs | List of strings; default is  | 
| sdk_frameworks | List of strings; default is  When linking a top level Apple binary, all SDK frameworks listed in that binary's transitive dependency graph are linked. | 
| sdk_includes | List of strings; default is  #include/#importsearch paths to add to this target
and all depending targets, where each path is relative to$(SDKROOT)/usr/include. | 
| stamp | Boolean; default is  | 
| textual_hdrs | List of labels; default is  | 
| weak_sdk_frameworks | List of strings; default is  |