Skip to content

Don't require objc in modulemaps generated for Swift compatibility headers #616

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

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Jun 26, 2025

Let's remove the requires objc from the module map file generated for the compatibility header. This condition triggered an error when importing the compatibility header from a C source file.

The require objc isn't necessary, the compatibility header is already printed in a way where the Objective-C code is protected behind a language check. C clients can safely import the current compatibility header even if they may not see any content.

Let's lift this restriction. It isn't currently necessary and we're adding C content to the compatibility header with the official support for @cdecl that is independent of Objective-C.

swiftpm equivalent change: swiftlang/swift-package-manager#8736

…aders

Let's remove the `requires objc` from the module map file generated for
the compatibility header. This condition triggered an error when
importing the compatibility header from a C source file.

This declaration is superfluous, the compatibility header is already
printed in a way where the Objective-C code is protected behind a
language check. C clients can safely import the current compatibility
header even if they may not see any content.

Let's lift this restriction. It isn't currently necessary and we're
adding C content to the compatibility header with the official support
for `@cdecl` that is independent of Objective-C.
@xymus
Copy link
Contributor Author

xymus commented Jun 27, 2025

@swift-ci please test

@xymus
Copy link
Contributor Author

xymus commented Jun 27, 2025

@swift-ci please test macOS

@xymus xymus merged commit 8888752 into swiftlang:main Jun 30, 2025
24 checks passed
@xymus xymus deleted the c-compat-modulemaps branch June 30, 2025 19:16
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