diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -48,6 +48,7 @@ if 'linux' in sys.platform: CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_linux'),) if 'openbsd' in sys.platform: CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_openbsd'),) +ADDRESS_SORTING_INCLUDE = (os.path.join('third_party', 'address_sorting', 'include'),) README = os.path.join(PYTHON_STEM, 'README.rst') # Ensure we're in the proper directory whether or not we're being used by pip. @@ -103,9 +104,9 @@ ENABLE_DOCUMENTATION_BUILD = os.environ.get( EXTRA_ENV_COMPILE_ARGS = os.environ.get('GRPC_PYTHON_CFLAGS', None) EXTRA_ENV_LINK_ARGS = os.environ.get('GRPC_PYTHON_LDFLAGS', None) if EXTRA_ENV_COMPILE_ARGS is None: - EXTRA_ENV_COMPILE_ARGS = '' + EXTRA_ENV_COMPILE_ARGS = ' -std=c++11' if 'win32' in sys.platform and sys.version_info < (3, 5): - EXTRA_ENV_COMPILE_ARGS += ' -std=c++11' + EXTRA_ENV_COMPILE_ARGS += ' -D_hypot=hypot' # We use define flags here and don't directly add to DEFINE_MACROS below to # ensure that the expert user/builder has a way of turning it off (via the # envvars) without adding yet more GRPC-specific envvars. @@ -115,10 +116,10 @@ if EXTRA_ENV_COMPILE_ARGS is None: else: EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime64 -D_timeb=__timeb64' elif "linux" in sys.platform: - EXTRA_ENV_COMPILE_ARGS += ' -std=c++11 -std=gnu99 -fvisibility=hidden -fno-wrapv -fno-exceptions' + EXTRA_ENV_COMPILE_ARGS += ' -std=gnu99 -fvisibility=hidden -fno-wrapv -fno-exceptions' elif "darwin" in sys.platform: EXTRA_ENV_COMPILE_ARGS += ' -fvisibility=hidden -fno-wrapv -fno-exceptions' -EXTRA_ENV_COMPILE_ARGS += ' -DPB_FIELD_16BIT' +EXTRA_ENV_COMPILE_ARGS += ' -DPB_FIELD_16BIT' if EXTRA_ENV_LINK_ARGS is None: EXTRA_ENV_LINK_ARGS = '' @@ -149,7 +150,7 @@ if "win32" in sys.platform: EXTENSION_INCLUDE_DIRECTORIES = ( (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE + - CARES_INCLUDE) + CARES_INCLUDE + ADDRESS_SORTING_INCLUDE) EXTENSION_LIBRARIES = () if "linux" in sys.platform: @@ -181,7 +182,7 @@ LDFLAGS = tuple(EXTRA_LINK_ARGS) CFLAGS = tuple(EXTRA_COMPILE_ARGS) if "linux" in sys.platform or "darwin" in sys.platform: pymodinit_type = 'PyObject*' if PY3 else 'void' - pymodinit = '__attribute__((visibility ("default"))) {}'.format(pymodinit_type) + pymodinit = 'extern "C" __attribute__((visibility ("default"))) {}'.format(pymodinit_type) DEFINE_MACROS += (('PyMODINIT_FUNC', pymodinit),) DEFINE_MACROS += (('GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK', 1),) @@ -238,9 +239,6 @@ PACKAGE_DIRECTORIES = { INSTALL_REQUIRES = ( 'six>=1.5.2', - # TODO(atash): eventually split the grpcio package into a metapackage - # depending on protobuf and the runtime component (independent of protobuf) - 'protobuf>=3.5.0.post1', ) if not PY3: |