-
Notifications
You must be signed in to change notification settings - Fork 126
Change how libraries are specified to the linker when using searched libs #890
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
base: main
Are you sure you want to change the base?
Conversation
|
@swift-ci test |
c224e9e to
843e629
Compare
e6674c3 to
3d422f3
Compare
|
@swift-ci test |
3d422f3 to
27d13e5
Compare
|
@swift-ci test |
…libs - remove the platform specifics from computeLibraryArgs (we cannot assume that all libraries have a lib prefix and what there suffix is.) So we now use the FileType prefix and remove any suffix when using searchPathFlagsForLD, moving this into the LinkerSpec.LibrarySpecifier extension, this allows for proper searching of libraries, and linking of dynamic libraries (especially on Windows).
27d13e5 to
4fe5921
Compare
|
@swift-ci test |
| } | ||
|
|
||
| if specifier.useSearchPaths, basename.hasPrefix("lib"), basename.hasSuffix(".a") { | ||
| if specifier.useSearchPaths { |
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.
Should we emit some kind of warning here if the library name doesn't have one of the prefixes we think will allow it to be found via search paths?
| fileprivate extension LinkerSpec.LibrarySpecifier { | ||
| func searchPathFlagsForLd(_ name: String) -> [String] { | ||
| func searchPathFlagsForLd() -> [String] { | ||
| let strippedName: String |
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.
Same question here, should we warn if we get a filename format we don't recognize here / don't think will be found?
| self.dsymPath = dsymPath | ||
| self.xcframeworkSourcePath = xcframeworkSourcePath | ||
| self.privacyFile = privacyFile | ||
| self.libPrefix = prefixes.first |
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.
Why do we only consider the first element here?
|
overall this looks great, just have a few questions |
|
we should also run this through cross-repo testing before merging |
that all libraries have a lib prefix and what there suffix is.) So we
now use the FileType prefix and remove any suffix when using
searchPathFlagsForLD, moving this into the LinkerSpec.LibrarySpecifier
extension, this allows for proper searching of libraries, and linking
of dynamic libraries (especially on Windows).