Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extension_safe attr not passing copts #878

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

luispadron
Copy link
Collaborator

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

@@ -589,7 +589,9 @@ def apple_library(

# Set extra linkopt for application extension safety
if extension_safe:
linkopts.append("-fapplication-extension")
linkopts += ["-fapplication-extension"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use += here instead of append so that select is supported.

@jszumski
Copy link
Collaborator

jszumski commented Jun 18, 2024

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"]},
),

When using `extension_safe` the `copt` for the objc/swift library must also supply `-fapplication-extension`/`-application-extension`
@luispadron luispadron force-pushed the luis/fix-extension-safe-attr branch from ade4429 to 2bfac3d Compare June 18, 2024 16:26
@luispadron
Copy link
Collaborator Author

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

@luispadron luispadron enabled auto-merge (squash) June 18, 2024 16:32
@luispadron luispadron merged commit ec08184 into master Jun 18, 2024
12 checks passed
@luispadron luispadron deleted the luis/fix-extension-safe-attr branch June 18, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants