[Qbs] dependency tracking

Richard Weickelt richard at weickelt.de
Thu Sep 17 01:24:42 CEST 2020


>> "testinput.h" file contains "#include "a.h" directive. Changing 
>> testinput.h results in a generator run followed by a C++ compiler run. 
>> Changing a.h results in no action, although in this case the generator 
>> is intended to reprocess its input.
> 
> It's expected that the generator won't re-run, because the dependency
> parsing happens when building a cpp file, i.e. all the headers are
> dependencies of the object file, and the header files themselves are only
> "passed through" by the scanning process. Though you might be able to
> cheat by setting up a dummy cpp file that includes the top-level header
> and making that an input to the generator rule.

As Christian said: The problem is that the cpp scanner is triggered by the
generated cpp file, but there is no connection to the testinput.h because
your cpp files is not including it.

If you could add the following lines to your generated cpp file:

    #ifdef IGNORED
    #include "testinput.h"
    #endif

then this should be enough to make the cpp scanner think that you are
actually including testinput.h and hence, it will see and track a.h as well.

Richard


More information about the Qbs mailing list