diff options
Diffstat (limited to 'python')
-rwxr-xr-x | python/google/protobuf/__init__.py | 2 | ||||
-rwxr-xr-x | python/setup.py | 26 |
2 files changed, 23 insertions, 5 deletions
diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 950f9b2d..d4360727 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -30,7 +30,7 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.5.1' +__version__ = '3.5.2' if __name__ != '__main__': try: diff --git a/python/setup.py b/python/setup.py index 6f5315f7..afe021fe 100755 --- a/python/setup.py +++ b/python/setup.py @@ -179,9 +179,6 @@ if __name__ == '__main__': # extension. Note that those libraries have to be compiled with # -fPIC for this to work. compile_static_ext = get_option_from_sys_argv('--compile_static_extension') - extra_compile_args = ['-Wno-write-strings', - '-Wno-invalid-offsetof', - '-Wno-sign-compare'] libraries = ['protobuf'] extra_objects = None if compile_static_ext: @@ -190,6 +187,27 @@ if __name__ == '__main__': '../src/.libs/libprotobuf-lite.a'] test_conformance.target = 'test_python_cpp' + extra_compile_args = [] + + if sys.platform != 'win32': + extra_compile_args.append('-Wno-write-strings') + extra_compile_args.append('-Wno-invalid-offsetof') + extra_compile_args.append('-Wno-sign-compare') + + # https://github.com/Theano/Theano/issues/4926 + if sys.platform == 'win32': + extra_compile_args.append('-D_hypot=hypot') + + # https://github.com/tpaviot/pythonocc-core/issues/48 + if sys.platform == 'win32' and '64 bit' in sys.version: + extra_compile_args.append('-DMS_WIN64') + + # MSVS default is dymanic + if (sys.platform == 'win32' and + ((sys.version_info[0] == 3 and sys.version_info[1] == 5) or + (sys.version_info[0] == 3 and sys.version_info[1] == 6))): + extra_compile_args.append('/MT') + if "clang" in os.popen('$CC --version 2> /dev/null').read(): extra_compile_args.append('-Wno-shorten-64-to-32') @@ -217,7 +235,7 @@ if __name__ == '__main__': Extension( "google.protobuf.internal._api_implementation", glob.glob('google/protobuf/internal/api_implementation.cc'), - extra_compile_args=['-DPYTHON_PROTO2_CPP_IMPL_V2'], + extra_compile_args=extra_compile_args + ['-DPYTHON_PROTO2_CPP_IMPL_V2'], ), ]) os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp' |