Re: How to detect the configuration?
Re: How to detect the configuration?
- Subject: Re: How to detect the configuration?
- From: "Clark Cox" <email@hidden>
- Date: Thu, 29 May 2008 12:50:00 -0700
On Thu, May 29, 2008 at 11:48 AM, Brian Stern <email@hidden> wrote:
>
> On May 29, 2008, at 2:16 PM, Chris Espinosa wrote:
>
>> 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
>>>>> 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).
>>
>> He meant "define it for the Debug configuration at the project level,"
>> which is exactly the right thing to do.
>
> OK Fair enough. I still don't understand this.
You can set build settings on individual targets, and you can set
build settings on the project itself. At *both* levels, settings are
segregated by configuration. Any build setting set in "configuration
X" of the project will automatically be inherited by "configuration X"
of any target in that project (assuming that they aren't overridden).
So set your macro in the Debug configuration of the Project itself
(but not the Release configuration), and do not set it in any of the
targets.
--
Clark S. Cox III
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