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

278 Views Asked by At

My Xcode project has different build configurations, and they define different preprocessor macros. 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. How does Xcode decide?

1

There are 1 best solutions below

0
On

After some experimenting, here's what the rules appear to be (on Xcode 13.0 beta 13A5155e):

  • If a configuration named Debug exists, it is used.
  • 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.