bazel-ios / rules_ios

Bazel rules for building iOS applications and frameworks
Apache License 2.0
276 stars 84 forks source link

Fix extension_safe attr not passing copts #878

Closed luispadron closed 2 months ago

luispadron commented 2 months ago

When using extension_safe the copt for the objc/swift library must also supply -fapplication-extension/-application-extension

jszumski commented 2 months ago

Thanks to this test for the help!

assert_xcconfig(
    name = "only_used_as_condition",
    xcconfig = {"APPLICATION_EXTENSION_API_ONLY": "YES"},
    expected = {"linkopts": ["-fapplication-extension", "-fapplication-extension"], "objc_copts": ["-fapplication-extension"], "swift_copts": ["-application-extension"]},
),
luispadron commented 2 months ago

Updated one of the examples, without this change it fails with:

tests/ios/frameworks/dynamic/b/lib.swift:11:15: error: 'accessoryCircular' is only available in iOS 16.0 or newer
            [.accessoryCircular]
              ^

so should catch regressions in the future too