How to get an Eclipse CDT project to auto-reload a .c file that has been externally modified
I'm using a ruby script to help generate a .c file based on another .c file (for a test harness called Unity). The script runs using the pre-build option, updates the file, but the cproject doesn't see the upadted file as being touched so doesn't rebuild with it. Using F5 updates it but I'd like to do this manually. I can't see how to m开发者_开发问答ake this happen.
I had the same issue generating a C file from a Python script.
What I ended up doing is to create a special Builder for that file.
If you go to the project properties, go on the Builders
tab and click New
. Then select Program
. You can fill all the information there. The important part is to go on the Refresh
tab and select Refresh resources upon completion
.
I also found it useful to unselect the stdio ("Allocate Console" in Build Options tab) so that it doesn't clear the console after a build.
the only drawback of that method is that the Builder doesn't pick-up dependencies and is called all the time.
精彩评论