[Scons-users] update dependency and signatures.dblite after biilding
于
yjtyzw at 126.com
Fri Jun 6 11:46:53 EDT 2025
My problem:
In my project, there are those code in some source files,
#define FOO_HEADER "foo.h"
#include FOO_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.
So I consider that whether could I update all the dependencies into signature with just one building.
that is my problem.
---- Replied Message ----
| From | Mats Wichmann<mats at wichmann.us> |
| Date | 6/6/2025 22:47 |
| To | SCons users mailing list<scons-users at scons.org>,
于<yjtyzw at 126.com> |
| Subject | Re: [Scons-users] update dependency and signatures.dblite after biilding |
On 6/6/25 08:29, 于 wrote:
Hi Bill,
As what you said, ParseDepends Function will lead to unnecessary
recompilations.
I have use ParseDepends Function to parse dependencies, and then, I need
two times to trace all the denpendencies.
I want trace all the dependencies with one building. I think that serval
steps can do it, but I don't know how to do it. So I ask for help form
community.
1. build source files to .o;
2. parse dependencies from .d;
3. update dependencies of source files manuly;
4. build elf;
I don't know how to implement the step 3, please experts help
me, thsnks.
Do you have a setup which produces the .d files? Not sure where you are
in this process.
ParseDepends() isn't very smart, and what it does under the covers ends
up being just issuing as many Depends() calls as necessary - another
function we usually advise against using, because you're forcing the
issue rather than letting SCons build up its own dependency tree. This
is what happens in ParseDepends after it's done with the parsing part:
for target, depends in tdlist:
self.Depends(target, depends)
My question is that could I update dependency and database manually
after building?
The signature database is in a format that can't be edited, as it
consists of pickled internal objects. All you can do is include
Depends() calls in your build to instruct SCons - or make the scanner
work correctly for your use case.
Sorry for not quite understanding - what is the actual problem you're
trying to solve?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20250606/f8377926/attachment.htm>
More information about the Scons-users
mailing list