• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to detect the configuration?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to detect the configuration?


  • Subject: Re: How to detect the configuration?
  • From: Brian Stern <email@hidden>
  • Date: Thu, 29 May 2008 13:54:56 -0400


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 Release
configuration (or any other, for that matter)? In Visual Studio, _DEBUG is
defined as a preprocessor symbol for Debug versions, but I can't find
anything similar in the project settings in XCode, or the docs. I can
manually add _DEBUG to the settings, but that's tedious in a project with a
dozen build targets. Is there anything automatically #defined?

There is no need to add it to a dozen build targets. Add it to the project, and it will be inherited by all of the targets in said project.

The whole point of DEBUG/RELEASE macros is that some build configurations #define one and the rest #define the other. It wouldn't make sense to #define DEBUG for all the build configurations in a project (at least not to me).


When this topic came up a few weeks ago Chris Espinosa said

>>>>>
At this point there's too much diversity in configuration names and developers' existing macros for us to impose this on projects unilaterally.
<<<<<


I really have to disagree. The Xcode team is letting the perfect be the enemy of the good. It would be good for the project templates to have DEBUG/RELEASE macros that matched the Debug/Release build configurations. That they can't be all things to all developers isn't a reason not to implement this. If there is a pre-defined macro then a developer can convert that #define into their own macro in the PCH file. This would be good. I don't see how having these macros pre- defined could cause a problem for anyone and they will solve a problem for most developers.

That this question comes up repeatedly on this list must mean something.

FWIW, CodeWarrior had these macros predefined in its project stationery and I never heard a complaint about it.

If I could figure out how to fix this in the project templates for myself I would.

--
Brian Stern
email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to detect the configuration?
      • From: Chris Espinosa <email@hidden>
    • Re: How to detect the configuration?
      • From: Jens Alfke <email@hidden>
    • Re: How to detect the configuration?
      • From: Ken Thomases <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>)

  • Prev by Date: Re: How to detect the configuration?
  • Next by Date: Re: How to detect the configuration?
  • Previous by thread: Re: How to detect the configuration?
  • Next by thread: Re: How to detect the configuration?
  • Index(es):
    • Date
    • Thread