<div dir="ltr"><div>Of course a better scanner is slower.. as would generating the .d files from the compiler..</div><div><br></div><div>That said, the scanner I pointed you at may have room for improvement in terms of performance.</div><div><br></div><div>Honestly.. IMHO using #define HEADER "xyz.h" and then #include HEADER is not great practice.</div><div><br></div><div>For your code how many instances of a header file defined by a macro are there?</div><div>Is it one, which is used all over the place?</div><div>Or many, used many places?</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Jun 6, 2025 at 10:20 AM 于 <<a href="mailto:yjtyzw@126.com">yjtyzw@126.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:微软雅黑"><div><br></div><div> Well, this is why Bill advised trying the C Conditional Scanner, which <br>*does* know how to handle preprocessor instructions of this sort. It's <br>still a bit of a work in progress (there are some questions about <br>recursion, in particular), which is why it's not the default. Were you <br>able to try that out? </div><div style="text-indent:2em"><br></div><div style="text-indent:2em">I have try it, as Bill and Mats said, CConditionalScanner can resolve my problem.</div><div style="text-indent:2em">And I find that after set CConditionalScanner, the building time change from 5min to 8min.</div><div id="m_3080952570899099365ntes-pcmac-signature" style="font-family:微软雅黑"><div style="font-size:14px;padding:0px;margin:0px"></div></div></div><div style="padding-top:1px;padding-bottom:1px;font-family:微软雅黑"><div style="margin:2em 0px 1em;font-size:14px;line-height:1.25;color:rgb(120,120,122)">---- Replied Message ----</div><div style="margin-bottom:1em;font-size:12px;line-height:1.25;color:rgb(35,35,36);padding:0.5em 0.25em;border-radius:0.67em;background-color:rgb(240,240,240)"><table width="100%" cellpadding="0" cellspacing="9" border="0" id="m_3080952570899099365ntes_editor_table_10010"><tbody><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:rgb(120,120,122)">From</td><td valign="top" style="font-size:12px;line-height:1.25;color:rgb(35,35,36);word-break:break-all"><a style="color:rgb(48,97,242);text-decoration:none" href="mailto:undefined" target="_blank">Mats Wichmann<mats@wichmann.us></a></td></tr><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:rgb(120,120,122)">Date</td><td valign="top" style="font-size:12px;line-height:1.25;color:rgb(35,35,36);word-break:break-all">6/6/2025 23:54</td></tr><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:rgb(120,120,122)">To</td><td valign="top" style="font-size:12px;line-height:1.25;color:rgb(35,35,36);word-break:break-all"><a style="color:rgb(48,97,242);text-decoration:none" href="mailto:yjtyzw@126.com" target="_blank">于<yjtyzw@126.com></a></td></tr><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:rgb(120,120,122)">Cc</td><td valign="top" style="font-size:12px;line-height:1.25;color:rgb(35,35,36);word-break:break-all"><a style="color:rgb(48,97,242);text-decoration:none" href="mailto:scons-users@scons.org" target="_blank">SCons users mailing list<scons-users@scons.org></a></td></tr><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:rgb(120,120,122)">Subject</td><td valign="top" style="font-size:12px;line-height:1.25;color:rgb(35,35,36);word-break:break-all">Re: [Scons-users] update dependency and signatures.dblite after biilding</td></tr></tbody></table></div>On 6/6/25 09:46, 于 wrote:<br><blockquote><br> My problem:<br> <br> <br> In my project, there are those code in some source files,<br> <br> #defineFOO_HEADER "foo.h"<br> #includeFOO_HEADER<br> <br> <br> <br> and the files are independent module, I can't modify them.<br> <br> the scons-user.pdf said, scons the built-in C scanner is unable to<br> extract the implicit dependency on a header file.<br> So I create .d file for every source file, and parse dependencies<br> from .d, and then add dependency by Depends function.<br> <br> And then, there is a new problem, when there are no .d, (for<br> example the first building or dependencies are changed), I need to<br> build project with two times, and then I can push all the<br> dependencies into signature.<br></blockquote><br>yes, this isn't ideal - if the dependencies can't be automatically <br>determined, you have both a first-run problem and no detection of changes.<br><br><blockquote><br> <br> So I consider that whether could I update all the dependencies into<br> signature with just one building.<br> that is my problem.<br> <br></blockquote>Well, this is why Bill advised trying the C Conditional Scanner, which <br>*does* know how to handle preprocessor instructions of this sort. It's <br>still a bit of a work in progress (there are some questions about <br>recursion, in particular), which is why it's not the default. Were you <br>able to try that out?<br><br></div></div>_______________________________________________<br>
Scons-users mailing list<br>
<a href="mailto:Scons-users@scons.org" target="_blank">Scons-users@scons.org</a><br>
<a href="https://pairlist4.pair.net/mailman/listinfo/scons-users" rel="noreferrer" target="_blank">https://pairlist4.pair.net/mailman/listinfo/scons-users</a><br>
</blockquote></div>