Hello,
I'd like __FILE__ to only report the filename, not the whole path. In IAR this is done with the --no_path_in_file_macros command line option. Is there a way to do this in CCS?
Thanks,
Derek
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.
Hello,
I'd like __FILE__ to only report the filename, not the whole path. In IAR this is done with the --no_path_in_file_macros command line option. Is there a way to do this in CCS?
Thanks,
Derek
Hi Derek,
I'm working with CCS 5.3.0.
The following solution works fine for me:
- Go to PROJECT -> PROPERTIES -> CCS Build -> ARM Compiler -> Advanced Options -> Predefined Symbols
- Add FILENAME_IN_ECLIPSE_PROJECT="\"${InputFileName}"\"
Now, you can use the FILENAME_IN_ECLIPSE symbol (like __FILE__).
(It will expand to the file name only - without path)
e.g.: Put the following line in every source file of your project:
static const char AC_ModuleName[] = FILENAME_IN_ECLIPSE_PROJECT;
or something like that:
error_write(FILENAME_IN_ECLIPSE_PROJECT, __LINE__, -1);
Regards, Andy
PS:
Solution idea comes from the following thread:
http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/183984.aspx