diff options
author | Mark Slee <mcslee@apache.org> | 2006-10-31 05:09:24 +0000 |
---|---|---|
committer | Mark Slee <mcslee@apache.org> | 2006-10-31 05:09:24 +0000 |
commit | e2bd58da293bfefc5082d7e227b7b4244c73b497 (patch) | |
tree | 658727494b36a99ddaeb7bd26f6f06decf6ea370 | |
parent | 725f9e6c710d718d3763d025d34cd4ad1ce34e87 (diff) | |
download | thrift-e2bd58da293bfefc5082d7e227b7b4244c73b497.tar.gz |
Add python scons rules
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664860 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | bootstrap.sh | 1 | ||||
-rw-r--r-- | lib/py/src/TSCons.py | 11 | ||||
-rw-r--r-- | lib/py/src/__init__.py | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/bootstrap.sh b/bootstrap.sh index 9d8ac58be..e994cc177 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -29,7 +29,6 @@ install-sh \ .libs \ libtool \ ltmain.sh \ -Makefile.in \ missing echo "SUBDIRS = ${subdirs}" > Makefile.am diff --git a/lib/py/src/TSCons.py b/lib/py/src/TSCons.py new file mode 100644 index 000000000..430b43fd7 --- /dev/null +++ b/lib/py/src/TSCons.py @@ -0,0 +1,11 @@ +from SCons.Builder import Builder + +def scons_env(env): + cppbuild = Builder(action = 'thrift --cpp $SOURCE') + env.Append(BUILDERS = {'ThriftCpp' : cppbuild}) + +def gen_cpp(env, dir, file): + scons_env(env) + suffixes = ['_types.h', '_types.cpp'] + targets = map(lambda s: 'gen-cpp/' + file + s, suffixes) + return env.ThriftCpp(targets, dir+file+'.thrift') diff --git a/lib/py/src/__init__.py b/lib/py/src/__init__.py index 9ddc3ce1c..11aeca94c 100644 --- a/lib/py/src/__init__.py +++ b/lib/py/src/__init__.py @@ -1 +1 @@ -__all__ = ["Thrift"] +__all__ = ["Thrift", "TSCons"] |