Re: Utilizing OTHER_CFLAGS properly?
Re: Utilizing OTHER_CFLAGS properly?
- Subject: Re: Utilizing OTHER_CFLAGS properly?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 22 Dec 2009 19:42:59 +0100
Le 22 déc. 2009 à 19:26, Sam Krishna a écrit :
> Hi Fritz,
>
> On Dec 22, 2009, at 10:01 AM, Fritz Anderson wrote:
>
>> I'm not Chris Espinosa; I don't even work for Apple. But maybe I know something...
>>
>
> Ahh... another Xcode god. Cool. :-)
>
>> On 22 Dec 2009, at 9:45 AM, Sam Krishna wrote:
>>
>>> I'm attempting to utilize OTHER_CFLAGS in the target's build settings (under User Defined settings) for different build configurations (Release vs. Debug vs. Demo, etc)
>>
>> Why are you attempting to set OTHER_CFLAGS as a user-defined setting? It already has a UI setting; I wonder if attempting to set it user-defined doesn't get overridden by the setting provided for the purpose.
>>
>> If the UI setting doesn't appear in the list, add a .c or .m file to the project. Xcode often won't include compiler settings until there's something in the target to compile.
>
> I definitely have a set of code files to compile.
>
>>
>>> Right now, I've tried:
>>>
>>> OTHER_CFLAGS=1
>>
>> Leaving aside the issue of whether it should be user-defined, this doesn't make sense. First, the UI separates the name of the setting from the value by putting them in different columns. An "=" shouldn't enter into it. Second, even if the syntax were right, simply adding a "1" to a gcc command line will only get you an error.
>>
>>> OTHER_CFLAGS="-DTEST_FLAG=1"
>>
>> There's already a UI setting for preprocessor defines. Search the build-setting list for "Preprocessor Macros" and "Preprocessor Macros not used in Precompiled Headers."
>>
>
> OK, I've removed OTHER_CFLAGS=1 from the Build Settings and here's what I'm trying now:
>
> (1) I've set a User-Defined setting for TEST_FLAG and set its value to 1.
>
> (2) I've put the following code in the app delegate method:
>
> - (void)applicationDidFinishLaunching:(UIApplication *)application {
>
> #if TEST_FLAG
> NSLog(@"Hey... we're here!");
> #endif
>
> ...
> }
>
> (3) When I compile and run the application in the simulator, nothing happens.
>
What you're looking for is not CFLAGS, but a Preprocessor Macros (search build settings).
-- Jean-Daniel
_______________________________________________
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