Add python scons rules
authorMark Slee <mcslee@apache.org>
Tue, 31 Oct 2006 05:09:24 +0000 (05:09 +0000)
committerMark Slee <mcslee@apache.org>
Tue, 31 Oct 2006 05:09:24 +0000 (05:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664860 13f79535-47bb-0310-9956-ffa450edef68

bootstrap.sh
lib/py/src/TSCons.py [new file with mode: 0644]
lib/py/src/__init__.py

index 9d8ac58..e994cc1 100755 (executable)
@@ -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 (file)
index 0000000..430b43f
--- /dev/null
@@ -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')
index 9ddc3ce..11aeca9 100644 (file)
@@ -1 +1 @@
-__all__ = ["Thrift"]
+__all__ = ["Thrift", "TSCons"]