Possibility of adding -emit-archive to swiftc

What are the reasons for swiftc lacking an -emit-archive flag to generate static libraries?

1 Like

Mostly just early on not yet having decided whether Swift would support static libraries at all. The answer to that has been "yes" for a long time, so patches welcome! (And that's probably a good name, better than -emit-library -static.)

2 Likes

Great, I was hoping the reasons were as simple as that. I'll get started on a patch soon.

3 Likes

Hey @Dave_Lee,

I was wondering what was going on with this. I think that this is part of what is keeping static libraries from being usable with Swift and CMake, so I would be interested in seeing this get done sooner rather than later.

hey! I had looked at it, but didn't get far and it hasn't been something I've needed.

Glad to see that @Torust has started it in https://github.com/apple/swift/pull/25088.