Skip to content

Commit

Permalink
Support for alwayslink outputs.
Browse files Browse the repository at this point in the history
Bazel uses a different extension for things that are marked as alwayslink, so
support that extension also.

PiperOrigin-RevId: 553798483
(cherry picked from commit c9768e0)
Signed-off-by: Brentley Jones <github@brentleyjones.com>
  • Loading branch information
thomasvl authored and brentleyjones committed Oct 7, 2024
1 parent 3c6f190 commit b8b530a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ the `.private.swiftinterface` files are required in order to build any code that
| <a id="swift_import-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="swift_import-deps"></a>deps | A list of targets that are dependencies of the target being built, which will be linked into that target.<br><br>If the Swift toolchain supports implementation-only imports (`private_deps` on `swift_library`), then targets in `deps` are treated as regular (non-implementation-only) imports that are propagated both to their direct and indirect (transitive) dependents.<br><br>Allowed kinds of dependencies are:<br><br>* `swift_library` (or anything propagating `SwiftInfo`)<br><br>* `cc_library` (or anything propagating `CcInfo`)<br><br>Additionally, on platforms that support Objective-C interop, `objc_library` targets (or anything propagating the `apple_common.Objc` provider) are allowed as dependencies. On platforms that do not support Objective-C interop (such as Linux), those dependencies will be **ignored.** | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
| <a id="swift_import-data"></a>data | The list of files needed by this target at runtime.<br><br>Files and targets named in the `data` attribute will appear in the `*.runfiles` area of this target, if it has one. This may include data files needed by a binary or library, or other programs needed by it. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
| <a id="swift_import-archives"></a>archives | The list of `.a` files provided to Swift targets that depend on this target. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
| <a id="swift_import-archives"></a>archives | The list of `.a` or `.lo` files provided to Swift targets that depend on this target. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
| <a id="swift_import-module_name"></a>module_name | The name of the module represented by this target. | String | required | |
| <a id="swift_import-swiftdoc"></a>swiftdoc | The `.swiftdoc` file provided to Swift targets that depend on this target. | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `None` |
| <a id="swift_import-swiftinterface"></a>swiftinterface | The `.swiftinterface` file that defines the module interface for this target. May not be specified if `swiftmodule` is specified. | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `None` |
Expand Down
4 changes: 2 additions & 2 deletions swift/swift_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ swift_import = rule(
{
"archives": attr.label_list(
allow_empty = True,
allow_files = ["a"],
allow_files = ["a", "lo"],
doc = """\
The list of `.a` files provided to Swift targets that depend on this target.
The list of `.a` or `.lo` files provided to Swift targets that depend on this target.
""",
mandatory = False,
),
Expand Down

0 comments on commit b8b530a

Please sign in to comment.