Skip to content

Commit 639d53e

Browse files
committed
Bazel: Address Copilot review comment
1 parent 8080619 commit 639d53e

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

unified/swift-syntax-rs/BUILD.bazel

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ swift_runtime_libs(
1414

1515
swift_runtime_linking(
1616
name = "_swift_runtime_cc_info",
17+
visibility = ["//visibility:private"],
1718
)
1819

1920
# On Linux, provide the downloaded Swift runtime at link time and look beside
@@ -25,10 +26,7 @@ cc_library(
2526
"//conditions:default": [],
2627
}),
2728
target_compatible_with = UNIFIED_SUPPORTED_PLATFORMS,
28-
deps = select({
29-
"@platforms//os:linux": [":_swift_runtime_cc_info"],
30-
"//conditions:default": [],
31-
}),
29+
deps = [":_swift_runtime_cc_info"],
3230
)
3331

3432
# Swift FFI shim: wraps swift-syntax and exposes a small C ABI.

unified/swift-syntax-rs/swift_runtime_linking.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
load("@rules_swift//swift:swift.bzl", "swift_common")
44

55
def _swift_runtime_linking_impl(ctx):
6-
return [swift_common.get_toolchain(ctx).dynamic_runtime_cc_info]
6+
runtime_cc_info = swift_common.get_toolchain(ctx).dynamic_runtime_cc_info
7+
return [runtime_cc_info] if runtime_cc_info else []
78

89
swift_runtime_linking = rule(
910
implementation = _swift_runtime_linking_impl,

0 commit comments

Comments
 (0)