On 12 Jun 2005, at 1:25 PM, Jesse Grosjean wrote:
Create new Cocoa Application. Select the project and choose "get info" Click the build tab, verify that the debug configuration is set, and the Optimization Level is set to Fastest, Smallest.
Does anyone know why this would be the case?
This, of course, is not the controlling setting. The controlling setting is the Debug build configuration for the application _target_, which is set to -O0, overriding the (admittedly wrong) default set by the project Debug configuration.
Confusion over what-trumps-what (Target trumps Project) seems to be at the root of the conflicting reports of whether the templates set the right optimizations.
I see. The reason it made a difference in my case was because I was running a "Custom Executable" to run and debug my unit tests, I guess custom executables use the project configuration.
When you create a new Cocoa Application project in Xcode 2.1, here's what you get:
- Project Debug Configuration: Os Release Configuration: Os Default Configuration: Os - Target
Debug Configuration: O0 (target-specific override of project default setting) Release Configuration: Os Default Configuration: Os
Perhaps the Debug configuration in the Project should be -O0, so that you don't need a target-specific override. But out of the box, this is set up correctly.
If you set up a custom executable for debugging, but pointed it at the executable in the Release directory (instead of the one in the Debug directory), then you'd be attempting to debug an optimized executable regardless of what your Debug optimization settings are, at whatever level.
Chris |