
OK then, so it’s more or less clear how build settings are resolved, but what’s the practical application? Xcode will then set both CLANG_COVERAGE_MAPPING and CLANG_COVERAGE_MAPPING_LINKER_ARGS to YES under the hood. You can define a list type in Xcode UI because it allows multiple values input:

If not provided, the default value is an empty list. StringList and PathList are used to represent a list of string and path values, respectively. They also get special treatment when resolving wildcard characters like *. My guess is that Path type build settings are handled differently with regards to escaping whitespaces and other special characters. Path type is almost identical to String when used in xcspecs. Note that a string value doesn’t have to be quoted using double quotes.Īs a matter of fact, some build settings that have integer values are represented using String type with the default value set to 0, but not to "0". There are 6 different types of build settings:Ī build setting of String type has, well, a string value. Some of them have a corresponding comment in the code like // Hidden, but not all. For example, the display name for SWIFT_OPTIMIZATION_LEVEL is Optimization Level.Ī few build settings are hidden and never appear in Xcode UI. SWIFT_OPTIMIZATION_LEVEL.īuild settings may also have a Category, Description, and DisplayName properties. Name defines the build setting name, e.g.

For example, Swift xcspec contains specification for the Swift compiler tool, while Clang LLVM xcspec contains specifications for the Clang compiler, analyzer, a couple of migrators, and an AST builder tool.Ī tool specification includes such details as its name, description, identifier, executable path, supported file types, and more.Īll build settings (options) have Name and Type properties. Each xcspec contains a specification for one or more tools. These xcspecs reference each other and work together as a system. There are xcspecs for the Clang compiler ( Clang LLVM 1.0.xcspec), the Swift compiler ( Swift.xcspec), and linker ( Ld.xcspec), as well as a number of xcspecs for core build system and other tools. Xcode uses these specs to render build settings UI and to translate build settings to command line flags. xcspec file extensions stored deep inside the Xcode.app bundle. The answer to the questions above is Xcode Specs or xcspecs.

So, how does Xcode know which flags to map build settings to? Where is this mapping information stored, and can it be extracted? ⚙️ Xcode Specs

*Technically, it takes more than just setting CLANG_ENABLE_CODE_COVERAGE to enable code coverage, more details to come.
