How to build a swift executable for Linux on macOS

I am trying to build a swift executable on my MacBook for my Linux vServer.

I already tried using swiftc -target "x86_64-linux test.swift, but my macOS swift compiler shows this error: <unknown>:0: error: unable to load standard library for target 'x86_64--linux'

So I looked around and found this question: Swift on OS X compiling for Linux? and tried out this example script from apple to setup a cross-platform toolchain.

After trying to build a module like shown in the example text of the script, it compiled, but on my linux machine I now get this error: error while loading shared libraries: cannot open shared object file: No such file or directory which is strange, because swift is properly installed on my Linux machine and works.

So have I done anything wrong while cross-compiling the project, or is there a problem on my Linux machine? Also I wonder, if there is a more simple way of compiling a project for Linux on macOS, like changing the Build Settings in Xcode or something?

Thanks in advance,