[Scons-users] Error while refreshing build settings

Dirk Bächle tshortik at gmx.de
Thu Feb 14 18:43:25 EST 2013


Hi Michael,

just a few comments from my side that hopefully help you with the
further setup of your project:

On 14.02.2013 20:45, Michael Potter wrote:

> On Thu, Feb 14, 2013 at 1:34 PM, Russel Winder <russel at winder.org.uk> wrote:

>> On Wed, 2013-02-13 at 22:04 -0500, Michael Potter wrote:

>> […]

>>

> I have a #include "gensrc/joker.h" in diamond.c, so that should signal

> scons that it is a dependency. That dependency detection works if I

> do in-source build, but does not work if I do a out-of-source build.


Correct, for the in-source-tree build, SCons scans
'source/src/diamond.c' as a child of 'source/src/diamond.o'. This file
exists already and contains the #include reference to 'joker.h', so
SCons can pick the dependency up automatically.
But for the out-of-source configuration it builds 'build/src/diamond.o'
and therefore tries to scan 'build/src/diamond.c', which isn't there yet. :(


> As a test, I removed this line from your proposed solution:

> environment.Depends('diamond.o', 'joker.h')

> Dependency detection still worked. So I think that line was redundant

> with the automatic dependency detection. That is good.

>


My guess is, that so far you probably always did a full build (simply
called "scons" without specifying any targets) and were extremely lucky
that "joker.h" accidentally got built first in some cases.
Please try a

scons build/diamond

(specifying 'build/diamond' as the only target) for your
out-of-source-tree configuration, without an existing "joker.h". It
can't work like that...you really need to set an explicit dependency:

joker = env.make_define('gensrc/joker.h', 'src/joker.txt')
env.Depends('src/diamond.c', joker)

in order to provide enough info and get SCons started in all build cases.

Best regards and "Happy SConsing",

Dirk



More information about the Scons-users mailing list