简体   繁体   English

Xcode 如何决定用于自动完成的预处理器宏和其他构建设置?

[英]How does Xcode decide what preprocessor macros and other build settings to use for autocomplete?

My Xcode project has different build configurations, and they define different preprocessor macros.我的 Xcode 项目有不同的构建配置,它们定义了不同的预处理器宏。 Autocomplete doesn't work in #ifdef blocks that are ignored by the current preprocessor flags, so I want to control which build configuration Xcode uses for autocomplete.自动完成在当前预处理器标志忽略的 #ifdef 块中不起作用,因此我想控制 Xcode 用于自动完成的构建配置。 How does Xcode decide? Xcode 如何决定?

After some experimenting, here's what the rules appear to be (on Xcode 13.0 beta 13A5155e):经过一些试验,以下是规则(在 Xcode 13.0 beta 13A5155e 上):

  • If a configuration named Debug exists, it is used.如果存在名为Debug的配置,则使用它。
  • Otherwise, the configuration in the "Use for command line builds" menu is used.否则,将使用“用于命令行构建”菜单中的配置。

Interestingly this entirely ignores the configuration(s) selected in the current scheme.有趣的是,这完全忽略了当前方案中选择的配置。 Autocomplete still works if you delete every scheme.如果您删除每个方案,自动完成仍然有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM