| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On May 29, 2008, at 10:54 AM, Brian Stern wrote: On May 29, 2008, at 12:48 PM, Clark Cox wrote:On Thu, May 29, 2008 at 5:05 AM, Richard Kennaway<email@hidden> wrote:How can an XCode program detect whether it was built in Debug or Releaseconfiguration (or any other, for that matter)? In Visual Studio, _DEBUG isdefined as a preprocessor symbol for Debug versions, but I can't findanything similar in the project settings in XCode, or the docs. I canmanually add _DEBUG to the settings, but that's tedious in a project with adozen build targets. Is there anything automatically #defined?There is no need to add it to a dozen build targets. Add it to theproject, and it will be inherited by all of the targets in saidproject. The other thing to do is to command-click to multiple-select only the targets you want to apply this to and choose Get Info. Yes, with a group selection of targets you can set a uniform build setting on all of them at once. Handy, that. Even CodeWarrior couldn't do that :-) When this topic came up a few weeks ago Chris Espinosa said - any macro common enough to be useful has the risk of breaking somebody's project with a conflict or by introducing unexpected behavior - any macro uncommon enough to be safe won't benefit anybody out of the box; people will generally have to define DEBUG=$(XCODE_DEBUG_CONFIGURATION) or some such. At that point it's just as much work for everybody to define their own preferred debug macro in their own idiom, and more intuitive. In the future should we change the build system in a substantial way so that a change like this is in the noise, we definitely want to do something like this. If I could figure out how to fix this in the project templates for myself I would. find /Developer/Library/Xcode/Project\ Templates/Application -name "project.pbxproj" -exec xed {} \; For each file, search for "Build configuration list for PBXProject" (usually near the end of the file). Look for the line that says "/* Debug */" below that. Select the UUID next to it and do command-E-command-G; that takes you to its definition. In the build setting list, add GCC_PREPROCESSOR_DEFINITIONS = "_DEBUG=1"; Save, repeat. Chris |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden This email sent to email@hidden
| References: | |
| >Thanks for the warm invite! (From: Fred Gaddis <email@hidden>) | |
| >Re: Thanks for the warm invite! (From: "Michael Crawford" <email@hidden>) | |
| >Re: Thanks for the warm invite! (From: Jens Alfke <email@hidden>) | |
| >Re: Thanks for the warm invite! (From: "Michael Crawford" <email@hidden>) | |
| >How to detect the configuration? (From: Richard Kennaway <email@hidden>) | |
| >Re: How to detect the configuration? (From: "Clark Cox" <email@hidden>) | |
| >Re: How to detect the configuration? (From: Brian Stern <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.