#define INC_FILE "test.h"
#include INC_FILE
If I build the project, change something in test.h and re-build, C::B doesn't recompile.
It thinks all dependecies of main.c are satisfied. It is not able to consider test.h a dependecy for main.c, because it is a macro-replaced include file.
If I write:
#include "test.h"
it works.
Consider that I already added test.h file in the project.
Is there a solution to this problem?
Yes, don't use the macro hack :P
The other option is to patch depslib to parse this correctly.
Patching depslib may be much harder than it sounds, though. At least, in a portable, compiler-independent way.
It is not defined by the C standard how string concatenation or generally evaluation of macros within <> is implemented.
So, at best, one would be able to implement single-macro-expanding-to-single-string-literal substitution.
Ok, it seems C::B is not able to automatically find include dependecies when the file included is a macro.
Is there the possibility to add this dependency manually? Can I say to C::B that main.c depends from the content of test.h too?
Quote from: pozzugno on August 07, 2012, 03:36:33 PM
Is there the possibility to add this dependency manually? Can I say to C::B that main.c depends from the content of test.h too?
Using scripting as a pre-build step, yes.
QuoteUsing scripting as a pre-build step, yes.
I'm sorry, can you detail this point? Should I change the project to a custom makefile? What is the pre-build step to do?