[Scons-users] SCons code generation (e.g. protobuf) and VariantDir

Dirk Bächle tshortik at gmx.de
Sun May 4 19:20:58 EDT 2014


On 05.05.2014 00:48, Vinnie Falco wrote:

> Dirk:

>

> Thanks for getting back to me. We don't use a hierarchical build (just

> the SConstruct) so I'm not sure how passing variant_dir would be

> applicable or doable. In the replies on StackOverflow, "UncleZeiv"

> alludes to this list post:

> http://scons.tigris.org/issues/show_bug.cgi?id=2908

Have you tried running this example?
When I call "scons --tree=all" on it, I get an error:

scons: *** [build/variant1/test.o] Source `src/test.cc' not found,
needed by target `build/variant1/test.o'.

which is not really surprising to me. ;)
Maybe you can help out with a simple, self-contained example, that
demonstrates how things go wrong? Apart from proving the good ol'
"garbage in, garbage out", I mean.

There is a reason why the UserGuide introduces the "variant_dir="
parameter in connection with hierarchical SConscripts as the very first
option for separating source and build directories (chap. 15). The
VariantDir() method may be more flexible, but it's also very hard to
understand...so people have trouble setting things up correctly.


> The replies there exactly describe the problem. And they show how the

> VariantDir call effectively does nothing. When I run scons with

> --tree=all it is clear that the pb.cc file does not depend on the

> .proto or protoc.exe.

>

> What I am wondering is if any progress has been made on this front,

> because the latest version of SCons still has this problem.


Again, the UserGuide provides info and advice about how to set things
up, and the examples given there show that the VariantDir does work.
Call me ignorant, but at this point I don't see that SCons itself really
has a problem.

Regards,

Dirk



More information about the Scons-users mailing list