3 # Copyright (c) 2006- Facebook
4 # Distributed under the Thrift Software License
6 # See accompanying file LICENSE or visit the Thrift site at:
7 # http://developers.facebook.com/thrift/
9 from SCons
.Builder
import Builder
11 def scons_env(env
, add
=''):
12 lstr
= 'thrift --cpp ' + add
+ ' $SOURCE'
13 cppbuild
= Builder(action
= lstr
)
14 env
.Append(BUILDERS
= {'ThriftCpp' : cppbuild
})
16 def gen_cpp(env
, dir, file):
18 suffixes
= ['_types.h', '_types.cpp']
19 targets
= map(lambda s
: 'gen-cpp/' + file + s
, suffixes
)
20 return env
.ThriftCpp(targets
, dir+file+'.thrift')