Re: Pass a C option based on command-line output?
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