aboutsummaryrefslogtreecommitdiff
path: root/python/setup.py
diff options
context:
space:
mode:
authorliujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2010-12-08 03:45:27 +0000
committerliujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2010-12-08 03:45:27 +0000
commit9b7f6c544ae9546e7ae0c438e36900754edb108d (patch)
tree22aa38d996d14fbd1e34ea0ac3a1093d7acf01bc /python/setup.py
parent1fd96c43a01ec913a89de31c58c0bc9f1e5bf542 (diff)
downloadprotobuf-9b7f6c544ae9546e7ae0c438e36900754edb108d.tar.gz
protobuf-9b7f6c544ae9546e7ae0c438e36900754edb108d.tar.bz2
protobuf-9b7f6c544ae9546e7ae0c438e36900754edb108d.zip
Fix issues: 223 224 242.
Diffstat (limited to 'python/setup.py')
-rwxr-xr-xpython/setup.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/python/setup.py b/python/setup.py
index 47646a81..53e8b4a5 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -102,17 +102,22 @@ if __name__ == '__main__':
# Generate necessary .proto file if it doesn't exist.
# TODO(kenton): Maybe we should hook this into a distutils command?
generate_proto("../src/google/protobuf/descriptor.proto")
-
- python_c_extension = Extension("google.protobuf.internal._net_proto2___python",
- [ "google/protobuf/pyext/python_descriptor.cc",
- "google/protobuf/pyext/python_protobuf.cc",
- "google/protobuf/pyext/python-proto2.cc",
- ],
- include_dirs = [ "../src", ".", ],
- libraries = [ "protobuf" ],
- runtime_library_dirs = [ "../src/.libs" ],
- library_dirs = [ "../src/.libs" ],
- )
+ generate_proto("../src/google/protobuf/compiler/plugin.proto")
+
+ ext_module_list = []
+
+ # C++ implementation extension
+ if os.getenv("PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION", "python") == "cpp":
+ print "Using EXPERIMENTAL C++ Implmenetation."
+ ext_module_list.append(Extension(
+ "google.protobuf.internal._net_proto2___python",
+ [ "google/protobuf/pyext/python_descriptor.cc",
+ "google/protobuf/pyext/python_protobuf.cc",
+ "google/protobuf/pyext/python-proto2.cc" ],
+ include_dirs = [ "../src", ".", ],
+ libraries = [ "protobuf" ],
+ runtime_library_dirs = [ "../src/.libs" ],
+ library_dirs = [ "../src/.libs" ]))
setup(name = 'protobuf',
version = '2.4.0-pre',
@@ -132,12 +137,13 @@ if __name__ == '__main__':
'google.protobuf.internal.wire_format',
'google.protobuf.descriptor',
'google.protobuf.descriptor_pb2',
+ 'google.protobuf.compiler.plugin_pb2',
'google.protobuf.message',
'google.protobuf.reflection',
'google.protobuf.service',
'google.protobuf.service_reflection',
'google.protobuf.text_format' ],
- ext_modules = [ python_c_extension ],
+ ext_modules = ext_module_list,
url = 'http://code.google.com/p/protobuf/',
maintainer = maintainer_email,
maintainer_email = 'protobuf@googlegroups.com',