• 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: Pass a C option based on command-line output?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pass a C option based on command-line output?


  • Subject: Re: Pass a C option based on command-line output?
  • From: Chris Espinosa <email@hidden>
  • Date: Sat, 7 Jan 2006 13:34:34 -0800


On Jan 7, 2006, at 11:32 AM, Daniel Jalkut wrote:

What's the easiest way to convince Xcode to set a command-line option with the value of a shell command's output?

Specifically, I'm porting an app to Xcode which is currently built with a Makefile. The app passes a "-D HOSTNAME=`hostname`" argument in one of the compile rules. I've tried using `hostname` notation inside Xcode's "Other C Flags" build setting, but the back-tick magic doesn't work.

Invoking random shell commands at any given step in an Xcode compilation would introduce unbounded complexity, and things are bad enough as it is. Besides, you really don't need to backtick-execute a shell command to get the host name, it's already set in the shell's $HOSTNAME variable.


So in Preprocessor Definitions just set HOSTNAME=$HOSTNAME and be done with it.

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


  • Follow-Ups:
    • Re: Pass a C option based on command-line output?
      • From: Daniel Jalkut <email@hidden>
References: 
 >Pass a C option based on command-line output? (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: Xcode & Visual C++
  • Next by Date: Trolltech QT (was: Xcode & Visual C++)
  • Previous by thread: Pass a C option based on command-line output?
  • Next by thread: Re: Pass a C option based on command-line output?
  • Index(es):
    • Date
    • Thread