aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2018-04-02 15:55:28 -0700
committerGitHub <noreply@github.com>2018-04-02 15:55:28 -0700
commitc93174346149f259ebc85fdb46826fcf84abb07d (patch)
tree284fd957f2007db39101adb0d51ca0fb0b007255 /python
parent579f81e1c66d64395031a1bbcb54ba7a44dade55 (diff)
downloadprotobuf-c93174346149f259ebc85fdb46826fcf84abb07d.tar.gz
protobuf-c93174346149f259ebc85fdb46826fcf84abb07d.tar.bz2
protobuf-c93174346149f259ebc85fdb46826fcf84abb07d.zip
Merge branch (#4466)
* Fix setup.py for windows build. * Bump version number to 3.5.2 * Cat the test-suite.log on errors for presubits
Diffstat (limited to 'python')
-rwxr-xr-xpython/google/protobuf/__init__.py2
-rwxr-xr-xpython/setup.py26
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'