https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
n

Nicholas Tian

03/17/2021, 12:23 AM
Hi there, I would like to create a static lib from my KMM project (into my Swift framework project), any recommended best practice? I have built a static library from my KMM project but the generated header is more geared towards C rather than Objective-C or Swift. The dynamic framework generated from the KMM project has the correct/Swift-y header I'd like to have. Any idea how can I combine the best of these two worlds?
a

Artyom Degtyarev [JB]

03/17/2021, 6:36 AM
Hello! I think you’re searching for
isStatic
option. Please have a look at its description and usage here.
n

Nicholas Tian

03/17/2021, 10:45 PM
Thanks! I will check it out!
@Artyom Degtyarev [JB] There is also a
staticLib
native target... ummm.. what is the difference between
staticLib
vs.
framework + isStatis = true
?
@Artyom Degtyarev [JB] I tried the
isStatic
option and it gave me a
.klib
binary. I don't think this is what I am looking for...
huh... I tried the
packForXcode
task and I got the thing I wanted. I will try that and see how it goes.
a

Artyom Degtyarev [JB]

03/18/2021, 7:41 AM
The latter is about creating a static framework. See this thread at stackoverflow, there are some good answers for it: https://stackoverflow.com/questions/15331056/library-static-dynamic-or-framework-project-inside-another-project
n

Nicholas Tian

03/19/2021, 3:56 AM
@Artyom Degtyarev [JB] Thank you so much! It has been super helpful 😄
19 Views