• 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: date-time info at compile time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date-time info at compile time


  • Subject: Re: date-time info at compile time
  • From: "Ray, Jeffrey R. {Jeff}(DFRC-ME)" <email@hidden>
  • Date: Thu, 14 May 2009 20:10:45 -0500
  • Acceptlanguage: en-US
  • Thread-topic: date-time info at compile time

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).

This is rather convoluted because I had to use the same timestamp in
multiple targets, and it was reasonable to do a makeclean each time i wanted
a new timestamp.  With a bit of thought, it can probably be
simplified/improved considerably for your purpose.

-jrr

 _______________________________________________
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: date-time info at compile time
      • From: Peter O'Gorman <email@hidden>
References: 
 >date-time info at compile time (From: Paul M <email@hidden>)

  • Prev by Date: Re: iPhone Platform Compiler Symbol?
  • Next by Date: Re: Switching from Simulator to Device
  • Previous by thread: date-time info at compile time
  • Next by thread: Re: date-time info at compile time
  • Index(es):
    • Date
    • Thread