Is it possible to compile swift code to dynamic library ?


(Zheng Ping) #1

Compile swift code to dynamic library(a *.so file which is compatible with
C), and let the *.so file can be linked directly by a pure C project.

···

--
with kind regards


(Derrick Ho) #2

If you use the "swiftc" command it will create an executable. Maybe there
is a command in there to create linker files which you can offer to your c
project.

Any one on this threat super knowledgeable on the "swiftc" command?

···

On Thu, Feb 9, 2017 at 1:53 AM Zheng Ping via swift-evolution < swift-evolution@swift.org> wrote:

Compile swift code to dynamic library(a *.so file which is compatible with
C), and let the *.so file can be linked directly by a pure C project.

--
with kind regards
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Jean-Daniel) #3

This is what Xcode do when it build a framework. Note that your application while have to link on the Swift runtime though.

···

Le 9 févr. 2017 à 07:53, Zheng Ping via swift-evolution <swift-evolution@swift.org> a écrit :

Compile swift code to dynamic library(a *.so file which is compatible with C), and let the *.so file can be linked directly by a pure C project.

--
with kind regards
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution