Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Post-build steps - Get preprocessor symbols and include path
Post-build steps - Get preprocessor symbols and include path [message #1792332] Mon, 16 July 2018 08:05 Go to next message
Kevni Wysocki is currently offline Kevni WysockiFriend
Messages: 2
Registered: July 2018
Junior Member
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 #1792590 is a reply to message #1792332] Fri, 20 July 2018 03:15 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
(* deleted *) sorry. wrong post.

[Updated on: Fri, 20 July 2018 03:32]

Report message to a moderator

Re: Post-build steps - Get preprocessor symbols and include path [message #1792594 is a reply to message #1792590] Fri, 20 July 2018 03:36 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Trying to create more than one target using Managed Build isn't supported.
You could probably circumvent the design to get what you want but why do it the hard way?
You should use another project to build your library tests or write your own makefile.


[Updated on: Fri, 20 July 2018 03:48]

Report message to a moderator

Re: Post-build steps - Get preprocessor symbols and include path [message #1792620 is a reply to message #1792594] Fri, 20 July 2018 09:56 Go to previous message
Kevni Wysocki is currently offline Kevni WysockiFriend
Messages: 2
Registered: July 2018
Junior Member
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 !).
Previous Topic:Can't debug (Windows 10)
Next Topic:CDT doesn't save project environment variables
Goto Forum:
  


Current Time: Tue Apr 23 07:59:59 GMT 2024

Powered by FUDForum. Page generated in 0.03093 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top