Skip to content

Commit

Permalink
Fix extension_safe attr not passing copts (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
luispadron committed Jun 18, 2024
1 parent b0e257d commit ec08184
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rules/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,9 @@ def apple_library(

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

# Collect the swift_library related kwargs, these are typically only set when provided to allow
# for wider compatibility with rule_swift versions.
Expand Down
10 changes: 10 additions & 0 deletions tests/ios/frameworks/dynamic/b/lib.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import c
import WidgetKit

public struct B {
public static func run() { C.run() }
public static func NATURE_OF_B() { B.run() }

@available(iOS 14.0, *)
public static func runExtension() -> [WidgetFamily] {
if #available(iOSApplicationExtension 16.0, *) {
[.accessoryCircular]
} else {
[]
}
}
}

0 comments on commit ec08184

Please sign in to comment.