build setting

A build setting provides information necessary for building the product of a target. For each task performed during the build process, such as compiling Swift code, build settings control how that task is performed. Build settings have default values, based on architecture and SDK. These defaults can be overridden by defining project-level values and target-level values. There are hundreds of configurable build settings, which are configurable in the Build Settings pane of the project editor. Build settings values are often literal values, but they can cross-reference other build settings. Build settings can also be conditionalized based on factors such as build configuration, architecture, and SDK.

Build setting attributes

Each build setting has the following attributes:

Attribute

Description

Example

Human-readable name

(also referred to as “title”)

This name is displayed in the Build Settings pane of the project editor when Xcode is set to show setting titles.

Build Active Architecture Only

Declaration name

(also referred to as “name”)

This name is displayed in the Build Settings pane of the project editor when Xcode is set to show setting names.

Declaration names are also displayed in the Quick Help inspector when a build setting is selected in the project editor.

Declaration names are also used in build configuration files and by the xcodebuild command-line tool.

ONLY_ACTIVE_ARCH

Value type

Each build setting requires a specific type of value. There are numerous value types, but the following are the most common:

  • Boolean: A value of YES or NO.

  • string: A specified text value.

  • enumeration (string): A predefined text value.

  • string list: A space-separated list of string values. If a string within a string list contains spaces, then the string must be surrounded by quotes.

  • path: A file or directory path, in POSIX form.

  • path list: A space-separated list of path values. If a path within a path list contains spaces, then the path must be surrounded by quotes.

Value types are displayed in the Quick Help inspector when a build setting is selected in the project editor.

Boolean

Value

A value of the specified type.

YES