This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use environment variables within armcc -I option (Windows)

I'd like to have a Windows environment variable like MYINCDIR=c:\myincdir that specifies the root of a set of include directories and then use that variable within the -I command-line option of the compiler. I've tried these without success:

-I%MYINCDIR%\foo
-I"%MYINCDIR%\foo"
-I"%MYINCDIR%"\foo

to no avail.

Is there any way to pick up an environment variable into the -I option?

Thanks,
Andrew

Parents
  • You're leaving the crucial aspect of the problem out of the picture. That would be the tool you're using to call the compiler.

    It's that tool's job to expand environment variables, and it depends entirely on that tool how it's done. %MYINCDIR% would work in a Windows batch file (*.bat or *.cmd). Most Makefiles would use $(MYINCDIR), Unix-type shell scripts would use $MYINCDIR or ${MYINCDIR}, and IDEs use whatever they damn well please --- or they don't offer this feature at all.

Reply
  • You're leaving the crucial aspect of the problem out of the picture. That would be the tool you're using to call the compiler.

    It's that tool's job to expand environment variables, and it depends entirely on that tool how it's done. %MYINCDIR% would work in a Windows batch file (*.bat or *.cmd). Most Makefiles would use $(MYINCDIR), Unix-type shell scripts would use $MYINCDIR or ${MYINCDIR}, and IDEs use whatever they damn well please --- or they don't offer this feature at all.

Children