My Xcode project depends on another library, that cause errors in my project when I built it with [-O3]
option.
The errors are in just one file. So I want to turn off the [-O3]
option for that file.
Is it possible?
In Xcode, look under 'Build Settings' for your target, scroll to 'Swift Compiler - Code Generation' and then 'Optimization Level'. Ensure that 'None' is selected.
The 'Optimization Level' tells the compiler to optimize the build to a certain level. Generally, debug builds are set with 'No Optimization' since it allows the developers to debug through the values contained by let/ var. This is very much required during the debugging phase.
GCC has a range of optimization levels, plus individual options to enable or disable particular optimizations. The overall compiler optimization level is controlled by the command line option -On, where n is the required optimization level, as follows: -O0 . (default).
Open the target, look under Build Phases
. Open the Compile Sources
step. Locate the file in question, and click the Compiler flags
column to the right.
Enter -O0
to turn off optimisation.
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