diff options
author | Bo Yang <teboring@google.com> | 2016-12-21 16:50:56 -0800 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2016-12-22 15:24:53 -0800 |
commit | 117f7716414bb0826ad4b78d9b27f30e6f8e2e24 (patch) | |
tree | 491166f8519f38b161d8da82fa0082c487f14b95 /python/setup.py | |
parent | 2f38ce1f989366181e6677bbfbad07f4a074c7fb (diff) | |
download | protobuf-117f7716414bb0826ad4b78d9b27f30e6f8e2e24.tar.gz protobuf-117f7716414bb0826ad4b78d9b27f30e6f8e2e24.tar.bz2 protobuf-117f7716414bb0826ad4b78d9b27f30e6f8e2e24.zip |
Update _GNUC_VER to use the correct implementation of atomic operation on Mac.
Diffstat (limited to 'python/setup.py')
-rwxr-xr-x | python/setup.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/python/setup.py b/python/setup.py index ef1a31b4..1683674e 100755 --- a/python/setup.py +++ b/python/setup.py @@ -5,6 +5,7 @@ import glob import os import subprocess import sys +import platform # We must use setuptools, not distutils, because we need to use the # namespace_packages option for the "google" package. @@ -189,6 +190,12 @@ if __name__ == '__main__': if "clang" in os.popen('$CC --version 2> /dev/null').read(): extra_compile_args.append('-Wno-shorten-64-to-32') + v, _, _ = platform.mac_ver() + if not v: + v = float('.'.join(v.split('.')[:2])) + if v >= 10.12: + extra_compile_args=['-std=c++11'], + if warnings_as_errors in sys.argv: extra_compile_args.append('-Werror') sys.argv.remove(warnings_as_errors) |