blob: 430b43fd75f50efe7e828af22f706fa53c066c1a [file] [log] [blame]
Mark Sleee2bd58d2006-10-31 05:09:24 +00001from SCons.Builder import Builder
2
3def scons_env(env):
4 cppbuild = Builder(action = 'thrift --cpp $SOURCE')
5 env.Append(BUILDERS = {'ThriftCpp' : cppbuild})
6
7def gen_cpp(env, dir, file):
8 scons_env(env)
9 suffixes = ['_types.h', '_types.cpp']
10 targets = map(lambda s: 'gen-cpp/' + file + s, suffixes)
11 return env.ThriftCpp(targets, dir+file+'.thrift')