• 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: how to include script-generated code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to include script-generated code?


  • Subject: Re: how to include script-generated code?
  • From: Chris Espinosa <email@hidden>
  • Date: Wed, 22 Nov 2006 15:34:20 -0800


On Nov 22, 2006, at 2:50 PM, Jeff Ray wrote:

I'm new to xcode, so please forgive me if this has an obvious solution.


I have a large, cross-platform application, which I am currently building via makefiles.  I am attempting to move it to xcode, and am having trouble translating the notion of creating a source file via a script.


I can create a Run Script target, and make it execute a script that creates a source file (timestamp.cpp).  I've even managed to get it to create this file as  $DERIVED_FILE_DIR/timestamp.cpp, which the docs seem to suggest is where xcode expects to find such things.


What I can't figure out is how to add a "compile source" build rule, nor how to tell the rull to compile this particular source, nor how to express the dependency to other targets' "link" rules.


Clue for the clueless?


Xcode doesn't have a good mechanism for specifying "this file that doesn't exist yet, but will."  So you have to build this up in stages:

1) Write your Run Script build phase 
2) Build the project, producing your .cpp output files.
3) Find those output files and add them to your project.  Don't check the "Copy into project folder" box.  Select the target that's supposed to build them.
4) Build the project.  The output library will be linked.
5) Add the produced library to the other target.  
6) Build the second target.  This should link to the first target library.

To set up the dependencies:
1) In the Run Script build phase, add the names of the input files to the Input Files list and the output files to the Output Files list.  This ensures the Run Script build phase gets triggered and that it triggers a recompile of the generated sources.
2) Open the second target, click its Dependencies tab, and drag the first target in.  That forces the first target to be brought up to date whenever the second is built.

Chris
 _______________________________________________
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

References: 
 >how to include script-generated code? (From: Jeff Ray <email@hidden>)

  • Prev by Date: how to include script-generated code?
  • Next by Date: How build a dmg mirror from Xcode tools?
  • Previous by thread: how to include script-generated code?
  • Next by thread: How build a dmg mirror from Xcode tools?
  • Index(es):
    • Date
    • Thread