[Scons-users] update dependency and signatures.dblite after biilding
Mats Wichmann
mats at wichmann.us
Fri Jun 6 11:53:57 EDT 2025
On 6/6/25 09:46, 于 wrote:
>
> My problem:
>
>
> In my project, there are those code in some source files,
>
> #defineFOO_HEADER "foo.h"
> #includeFOO_HEADER
>
>
>
> and the files are independent module, I can't modify them.
>
> the scons-user.pdf said, scons the built-in C scanner is unable to
> extract the implicit dependency on a header file.
> So I create .d file for every source file, and parse dependencies
> from .d, and then add dependency by Depends function.
>
> And then, there is a new problem, when there are no .d, (for
> example the first building or dependencies are changed), I need to
> build project with two times, and then I can push all the
> dependencies into signature.
yes, this isn't ideal - if the dependencies can't be automatically
determined, you have both a first-run problem and no detection of changes.
>
>
> So I consider that whether could I update all the dependencies into
> signature with just one building.
> that is my problem.
>
Well, this is why Bill advised trying the C Conditional Scanner, which
*does* know how to handle preprocessor instructions of this sort. It's
still a bit of a work in progress (there are some questions about
recursion, in particular), which is why it's not the default. Were you
able to try that out?
More information about the Scons-users
mailing list