16.4 · Build settings, configurations, xcconfig, and compile times

The same source builds differently under different configurations. Build settings and the compiler’s build graph are where most “works on my machine” and “the build got slow” stories end up.

Mental model. Settings are layered values with a precedence order. Keep them in text files, and measure the build before changing it.

Settings and configurations

Debug and Release, xcconfig layering, and conditional compilation.

  1. What are build configurations and build settings, how do xcconfig files layer, and how does #if DEBUG work? 16.4.1 · L3
    A build configuration is a named set of build settings; Xcode projects start with Debug and Release, and you can add more (Staging, Beta, Enterprise). A build…

Build speed

Incremental builds, whole-module mode, explicit modules and the build timeline.

  1. How do you speed up and diagnose slow builds: incremental builds, whole-module optimisation, explicit modules and the build timeline? 16.4.2 · L5
    First measure. Build time has distinct parts: dependency resolution, compiling each module’s sources, linking, code signing, asset and resource processing, and…

More in Modularization & SPM