Re: date-time info at compile time
Re: date-time info at compile time
- Subject: Re: date-time info at compile time
- From: Peter O'Gorman <email@hidden>
- Date: Thu, 14 May 2009 20:49:56 -0500
Ray, Jeffrey R. {Jeff}(DFRC-ME) wrote:
> On 5/14/09 4:16 PM, "Paul M" <email@hidden> wrote:
>
>> I have a Makefile which generates a date-time spec when it runs, and
>> passes that into my code as a #Define, thereby allowing me to
>> automaticaly include build info in the executable.
>>
>> I'd like to find a way to do this from within XCode.
>
> We had to do something similar. I didn't know xcode very well (still don't,
> actually) so my solution may seem a bit convoluted.
>
> I created a header, which extern's the date and time statements. This gets
> included where necessary.
>
> I created a target, and added to that target a run script phase. In this
> script, I put a bunch of setenv commands to simulate the variable from the
> makefile. It then ran an external script file (common to all the unix
> platforms my app runs on), which generates a .cpp containing the actual
> date/time statements.
>
> I created a second target, dependant on the first. It compiles the .cpp
>
> I added the resulting .o to my app(s).
Probably stupid question:
Why not just use the __DATE__ and __TIME__ macros?
Peter
--
Peter O'Gorman
http://pogma.com
_______________________________________________
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