Building an executable project on Linux with static libraries with Swift 5.1.4


Is it possible to build a swift project on Linux using the -Xswiftc -static-stdlib so it can be executed on other Linux machines without the need to install swift?

I'm using the latest version of Swift (5.1.4) and when I type swift build -Xswiftc -static-stdlib for a file that contains import Foundation I'm getting:
/usr/bin/ error: cannot find -lFoundation /usr/bin/ error: cannot find -lswiftDispatch

I've already seen related posts but I couldn't find the right answer for me.

I believe that the swiftDispatch issue was resolved in 5.2, and it should be possible for you to backport the changes for building a 5.1.x release with that added.

Oh amazing! Do you know also if swiftFoundation is resolved in 5.2?