This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28335: OS-dependent path in predefined symbol definition

Part Number: TMS320F28335

Tool/software: Code Composer Studio

Hi, I'm working on a project where I need to have the path to the hex binary file of the compiled project accessible from within the source code.  We came up with a solution that works fine in Linux:

HEX_PATH=${PWD}/${BuildArtifactFileBaseName}.hex

This expands to /path/to/directory/blah.hex which appears to be a valid C macro.

In windows however, this expands to C:\path\to\directory/blah.hex and I get the following error during compilation:

Command-line error #1046: invalid macro definition: HEX_PATH=C:\path\to\directory/blah.hex

It appears this error is due to the C:\ portion of the definition.  "path\to\directory/blah.hex" seems to be a valid definition. 

I would like to avoid adding an additional configuration to the project just to handle this.  We also don't need the path to be correct in windows, we just need it to compile.

One option I thought of was using a ternary operator but this syntax hasn't worked for me:

HEX_PATH= (${HostOsName}=="Linux" ? ${PWD}/${BuildArtifactFileBaseName}.hex : ${BuildArtifactFileBaseName}.hex)

Thoughts or suggestions on how to solve this would be appreciated.