Re: date-time info at compile time
Re: date-time info at compile time
- Subject: Re: date-time info at compile time
- From: Paul M <email@hidden>
- Date: Fri, 15 May 2009 17:39:46 +1200
On 15/05/2009, at 1:49 PM, Peter O'Gorman wrote:
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
--
I give up, why aren't I using those? ...
I feel a bit silly now.
I may have created the makefile before I knew about those macros, and
have used
variants of it ever since. Or something.
Thanks
paulm
_______________________________________________
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