Build script documentation

I don't think there's great documentation, unfortunately.

You can list all ninja targets with ninja -t targets. The ones you're likely interested in are:

  • ninja swift: as mentioned above, builds the swift compiler without the stdlib (swift and swiftc binaries).
  • ninja swift-stdlib: builds the swift stdlib.
    • This takes a long time. If you want to test only the compiler, you'll need to build the stdlib just once. Then, you can just run ninja swift to build the compiler incrementally.
  • ninja sil-opt: builds the SIL optimizer utility, useful for testing SIL transformations.

@codafi has a great post on tips for building and testing, with a focus on testing.

2 Likes