[Scons-users] Why is clean now building doxygen?

Dominic Binks dominic.binks at thebinkles.net
Wed Jul 8 07:00:00 EDT 2015


The answer is simply understanding that SCons, like most build systems 
will perform a 'read' stage where it parses and builds the dependency 
tree to determine what needs to be built.  Then it goes away and builds 
it.  (Make actually does the same, GNU Make especially so, but it's much 
less obvious in most cases.)

Essentially *NEVER* use os.system to do anything in a SCons build script 
because it will almost always cause issues.  If you do need something 
run immediately (i.e. as the SConscripts are being read) use Execute().

However, that means it will still run when you clean as well.  It will 
run even when it isn't needed.  So it's still better to package it in a 
Command() to be scheduled later and then it will only be constructed if 
necessary.

Dominic

On 08/07/2015 11:52, Ridout, Aaron wrote:
> ... interestingly removing the function and calling doxygen twice
> with different doxyfiles solves the problem, as in:
>
> doxygen = Command('Output/doxywarnings.txt', Glob('*.h') +
> Glob('*.cpp'), ['doxygen Build/doxyfile.html', doxygen
> Build/doxyfile.warnings])
>
> So why does the python function get executed before scons outputs:
>
> scons: done reading SConscript files. scons: Cleaning targets ...
>
> Thanks, Aaron
>
> ________________________________
>
> Notice to recipient: This email is meant for only the intended
> recipient of the transmission, and may be a communication privileged
> by law, subject to export control restrictions or that otherwise
> contains proprietary information. If you receive this email by
> mistake, please notify us immediately by replying to this message and
> then destroy it and do not review, disclose, copy or distribute it.
> Thank you in advance for your cooperation.
> _______________________________________________ Scons-users mailing
> list Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>


More information about the Scons-users mailing list