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

Vinnie Falco vinnie at ripple.com
Sun May 4 18:15:52 EDT 2014


I'm working on a project that uses SCons and protocol buffers from
C++. I learned Python and SCons and added support for variant
directories. But there's a problem, and one that it seems others have
had.

My SConstruct invokes a protoc builder on src/ripple.proto to produce
build/proto/ripple.pb.cc and build/proto/ripple.pb.h. I use
VariantDir('build/debug/proto', 'build/proto') to establish a variant
(the real file has 12 variants). But when I call
env.Object('build/debug/proto/ripple.pb.cc') SCons does not realize
that it has to first call protoc and produces the error 'ripple.pb.cc
required for ripple.pb.obj'.

This problem is explained clearly in this old StackOverflow question,
to which I have added a reputation bounty:

http://stackoverflow.com/questions/16545459/scons-code-generation-and-variantdir

Thoughts?


More information about the Scons-users mailing list