I would like to add two compiler flags, one for ARC (-fno-objc-arc) and one for warning (-w). Anybody know how to add two compiler flags in the Xcode build phase for a particular file?
You can then add swift compiler flags so that we can check the current configuration through code. To do that, goto Project (not target)→Build settings → Swift Compiler → Custom flags → Other swift flags section and edit the different configuration flags. Add the flags using the syntax “ -D <flag_name>”.
The main goal of Xcode Build System is to orchestrate execution of various tasks that will eventually produce an executable program. Xcode runs a number of tools and passes dozens of arguments between them, handles their order of execution, parallelism and much much more.
Choose the project in the Project Navigator on the left. Select the Configurations target from the Targets section and click the Build Settings tab at the top. The Build Settings tab shows the build settings for the Configurations target. It's possible to expand this list with build settings that you define.
The new setting is called "Active Compilation Conditions", which provides top-level support for the Swift equivalent of preprocessor flags. You use it in exactly the same way as you would "Other Swift Flags", except there's no need to prepend the value with a "-D" (so it's just a little cleaner).
Add the compiler flags under your Project -> Target -> Build Phases, just separate the flags by a space.
In Xcode, clic on your project file to see the pane with your target(s) and then :
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With