-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add modulemaps that work for statically compiled Foundation #2850
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
This so far only works for |
@swift-ci test linux |
CMakeLists.txt
Outdated
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS | ||
CoreFoundation CFXMLInterface CFURLSessionInterface) | ||
install(TARGETS CoreFoundation CFXMLInterface CFURLSessionInterface | ||
DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>) | ||
DESTINATION ${swift_lib_dir}/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>) |
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 seems incorrect. CoreFoundation
is always built statically for Foundation, so this should always be swift_static
right?
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.
Good catch!
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.
Oh, actually this is still correct because it will only be installed if we are compiling statically, in which case the variable is already set to lib/swift_static
. I can change it back if you want.
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.
That would be great.
DESTINATION | ||
lib/swift/CFXMLInterface) | ||
${swift_lib_dir}/CFXMLInterface) |
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.
Do we really need two copies of the headers? I think that I should revive my work to remove the private headers at least. We really want to stop propagating the CoreFoundation headers into the toolchain I think.
CC: @millenomi
The static libraries need to link against additional dependencies, which are listed in the newly added modulemaps
7be5a73
to
185640c
Compare
@swift-ci test linux |
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.
I'm fine with doing this for now to get the work unblocked but we should revisit the need for duplicating the headers. Could you please file a SR/radar before merging and reference it here?
Minor nit: mind pulling down the definition of swift_lib_dir
out of the current block and right before the blocks of install where is used?
@compnerd I'm not sure what you mean by pulling the definition of |
@swift-ci test |
Nice work, I just tried this out with the latest 8/18 official trunk snapshot build for Ubuntu and it works great. Any plans to backport these pulls to the 5.3 branch? I will do it for the Android builds I put out if not. |
@buttaface Thanks for the feedback! I am planning to backport this to 5.3 as well. |
Great, looking forward to it. |
The static libraries need to link against additional dependencies, which are listed in the newly added modulemaps