-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Generate the compatibility header for libraries on all platforms #8695
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
Conversation
Enable generating the compatibility header for library targets on all platforms by lifting the restriction on Darwin. As part of the work to formalize `@cdecl` we've been adding content to the compatibility header that is usable by C compilers without the need for Objective-C or modules. Lifting this restriction will allow Linux and Windows users to generate and import the compatibility header in their packages.
@swift-ci Please test |
Woohoo! |
Now that compatibility header tests run on Windows we need to update how we check for paths to support the platform properly.
@swift-ci Please test |
@swift-ci test windows |
Took a quick look at Swift Build and I think we don't need any changes there; I see in my Android builds that the -Swift.h file is already being generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me. I recommend doing a quick search of open GitHub issues that mention the generated header, because this probably fixes some.
@swift-ci Please test windows |
3 similar comments
@swift-ci Please test windows |
@swift-ci Please test windows |
@swift-ci Please test windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I found two related issues. #7319 should be fixed by this PR as they were only asking for the compatibility header to be generated on non-Darwin platforms. However there are still hurdles to import the compatibility header from a C/C++ source file and actually use it. I'm aware of two restrictions, both mentioned in #7257: the module map for the compatibility header is printed with |
Enable generating the compatibility header for library targets on all platforms by lifting the restriction to Darwin.
As part of the work to formalize
@cdecl
we've been adding content to the compatibility header that is usable by C compilers without the need for Objective-C or modules. Lifting this restriction will allow Linux and Windows users to generate and import the compatibility header to call@cdecl
functions in their package.