Skip to content

Commit ec08184

Browse files
authored
Fix extension_safe attr not passing copts (#878)
1 parent b0e257d commit ec08184

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

rules/library.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,9 @@ def apple_library(
589589

590590
# Set extra linkopt for application extension safety
591591
if extension_safe:
592-
linkopts.append("-fapplication-extension")
592+
linkopts += ["-fapplication-extension"]
593+
objc_copts += ["-fapplication-extension"]
594+
swift_copts += ["-application-extension"]
593595

594596
# Collect the swift_library related kwargs, these are typically only set when provided to allow
595597
# for wider compatibility with rule_swift versions.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import c
2+
import WidgetKit
23

34
public struct B {
45
public static func run() { C.run() }
56
public static func NATURE_OF_B() { B.run() }
7+
8+
@available(iOS 14.0, *)
9+
public static func runExtension() -> [WidgetFamily] {
10+
if #available(iOSApplicationExtension 16.0, *) {
11+
[.accessoryCircular]
12+
} else {
13+
[]
14+
}
15+
}
616
}

0 commit comments

Comments
 (0)