Fix portable Swift runtime linking in UIKit klibs - #3274
Fix portable Swift runtime linking in UIKit klibs#3274Vendula Švastalová (svastven) wants to merge 1 commit into
Conversation
c797150 to
ff2401b
Compare
251b219 to
3f54ee6
Compare
| .asText | ||
| .map { swiftcPath -> | ||
| File(swiftcPath.trim()) | ||
| .parentFile |
There was a problem hiding this comment.
Looks like xcrun --sdk [SDK_NAME] --show-toolchain-path can already give us
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
and then we can just resolve to usr/lib/swift/$sdkName
| } | ||
| } | ||
|
|
||
| private fun KotlinNativeTarget.configureSwiftCompatibilityLinking() { |
There was a problem hiding this comment.
Can we add a comment that explain the purpose of it?
My understanding so far is that Kotlin/Native doesn't know about this folder when linking. Because of that we are forced to create this logic not only in cmp-core but also inside our compose plugin.
Ideally, Kotlin/Native could take care of this automatically, since it already resolves the path to the linker from the toolchain.
https://youtrack.jetbrains.com/issue/KT-69793 seems related. Maybe we can ask the Kotlin/Native team to add it?
Avoid publishing Xcode path in the UIKit swiftUtils KLib metadata.
The Swift runtime library names remain portable linker requirements in
swiftUtils.def. And the active Xcode toolchain's Swift compatibility library directory is resolved lazily at final iOS link time.Fixes CMP-10607 Resolve Swift compatibility libraries from the consumer’s active Xcode during iOS linking
Release Notes
N/A