diff options
Diffstat (limited to 'python/setup.py')
-rwxr-xr-x | python/setup.py | 30 |
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', |