Compile Swift script with static Swift core library
The argument -static-stdlib
must be used:
swiftc -static-stdlib helloworld.swift
For swift build
, pass it to -Xswiftc
:
swift build -Xswiftc -static-stdlib
If you get an ICU dependency error, install it:
apt-get install libicu-dev