Re: environment variables during compile time
Re: environment variables during compile time
- Subject: Re: environment variables during compile time
- From: Marco S Hyman <email@hidden>
- Date: Wed, 13 Jul 2011 09:11:19 -0700
On Jul 13, 2011, at 5:38 AM, Vyacheslav Karamov wrote:
> man getenv
He wants them at COMPILE time. getenv won't help unless he modifies
the compiler to use it. :)
In general, the compiler can define values on the command line.
It can get the values from the environment.
test.c:
#include "stdio.h"
int main(int argc, char *argv[])
{
printf("FOO has a value of %s\n", FOO);
}
command line:
export bar='"this is bar"'
gcc -D"FOO=$bar" test.c
Output after compiling:
./a.out
FOO has a value of this is bar
I'll let the OP figure out how to do this in Xcode
/\/\arc
_______________________________________________
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