How to build optimized version of Swift Package using the Swift Package Manager `swift build` command
问题 I want to compile my swift code written in the new Swift Package Manager format into highly optimized binary code. This is possible currently using swiftc -O somefile.swift But since the swift packages are built using swift build command, I cannot pass -O option as it does not accept it. So is there a way to specify to optimize the code during the compile process? 回答1: You can build in a release configuration with: swift build --configuration release . You can also see the tool usage via: $