Post-build steps - Get preprocessor symbols and include path [message #1792332] |
Mon, 16 July 2018 08:05  |
Eclipse User |
|
|
|
Hi,
Let's explain what I would like to do.
Basically, I have a static library project (ARM target) with some source files, preprocessor symbols and include paths. One source file is excluded from build, it contains a main() function used to test the library. I don't want to include it to avoid to have many main() functions as the library is used by my application project. After building, I get a .a library files without compiling that test.c (no test.o object file).
I would like to have that test.c file compiled to get an application with which I could use to test some functions through command lines. So, I would like to use post-build steps to compile test.c and link with all other object files to get my test app.
So far, I am able to compile test.c with a command line like :
${cross_prefix}${cross_c}${cross_suffix} ${cross_toolchain_flags} -c -D__MY_DEFINED_SYMBOL__ -I/MY_INCLUDE_PATH -o test_${ProjName}.o ${workspace_loc:/${ProjName}}/src/test_${ProjName}.c
But I would like to replace "_MY_DEFINED_SYMBOL__" and "/MY_INCLUDE_PATH" by some variables that contains the symbol and paths defined in my project settings (basically, what's shown in "All options" textbox in Project Settings->C/C++ Build->Settings->C Compiler). If I add some path or whatever I don't want to modify that post-build command.
Does anybody know how I could do that ?
Thanks,
Kevin
|
|
|
|
|
Re: Post-build steps - Get preprocessor symbols and include path [message #1792620 is a reply to message #1792594] |
Fri, 20 July 2018 09:56  |
Eclipse User |
|
|
|
Actually, compiling the binary with post-build steps is working fine. I just want to make it easier when we have to add some symbols, include path, libraries .. (easier = automatic).
We already have 4 library projects working in this way, if we had to add an executable project per library, the number of projects into our workspace will grow for no significant reason (double projects per library). And we like to build the app and the library at the same time, no need to select the executable project after compiling the library to compile the test app ..
We already have custom makefiles to compile our projects from command-lines. I just want to make it more user friendly (some of my colleagues are command line-phobic !).
|
|
|
Powered by
FUDForum. Page generated in 0.03560 seconds