Xcode--------Building Settings

唐伟
2023-12-01

Build Settings

A build setting is a variable that contains information about how a particular aspect of a product’s build process should be performed. For example, the information in a build setting can specify which options Xcode passes to the compiler.

You can specify build settings at the project or target level. Each project-level build setting applies to all targets in the project unless explicitly overridden by the build settings for a specific target.

Each target organizes the source files needed to build one product. A build configuration specifies a set of build settings used to build a target's product in a particular way. For example, it is common to have separate build configurations for debug and release builds of a product.

A build setting in Xcode has two parts: the setting title and the definition. The build setting title identifies the build setting and can be used within other settings. The build setting definition is a constant or a formula Xcode uses to determine the value of the build setting at build time. A build setting may also have a display name, which is used to display the build setting in the Xcode user interface.

In addition to the default build settings provided by Xcode when you create a new project from a project template, you can create user-defined build settings for your project or for a particular target. You can also specify conditional build settings. The value of a conditional build setting depends on whether one or more prerequisites are met. This mechanism allows you to, for example, specify the SDK to use to build a product based on the targeted architecture.

自己翻得,凑合看:

编译设置是配置一个产品的各个具体方面在编译过程中如何进行的一系列变量。例如:编译设置中的信息可以指定Xcode把什么信息传给编译器。

你可以在Project或者Targets Level中指定编译设置。每个Project-Level编译设置项适应于所有这个工程中的Targets,除非特定的Target 重写这个设置项。

每个Target都组织编译一个项目必备的源文件。一种编译设置指定了一系列编译条件对这个Target的产品进行特定方式的编译。例如:把一个产品的debug版和release版分开设置编译条件比较常见。

在Xcode中一项编译设置分为两部分:设置标题和描述。设置标题用于分辨编译设置而且被用在其他设置中。在Xcode在编译的时候对于区别编译设置的值,设置标题是不变的或者准则。编译设置也会有显示名称,他们用来在用户界面显示编译设置。

除了用工程模板创建一个新工程时Xcode提供的默认编译设置以外,你可以为你的工程或特定的Target创建用户自定义编译设置。你也可以指定条件编译。条件编译的值取决于一个或者更多的先决条件是否得到满足。这个机制允许你指定使用的SDK在编译这种基于targeted结构的产品时。


From:http://developer.apple.com/library/ios/#featuredarticles/XcodeConcepts/Concept-Build_Settings.html#//apple_ref/doc/uid/TP40009328-CH6-SW1


 类似资料: