Merge pull request #24450 from mtorromeo/patch-2

Allow grpcio to be built against system re2
pull/24513/head
Richard Belleville 4 years ago committed by GitHub
commit 514dacb107
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      setup.py

@ -133,6 +133,11 @@ BUILD_WITH_SYSTEM_ZLIB = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ZLIB', False)
BUILD_WITH_SYSTEM_CARES = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_CARES', BUILD_WITH_SYSTEM_CARES = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_CARES',
False) False)
# Export this variable to use the system installation of re2. You need to
# have the header files installed (in /usr/include/re2) and during
# runtime, the shared library must be installed
BUILD_WITH_SYSTEM_RE2 = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_RE2', False)
# For local development use only: This skips building gRPC Core and its # For local development use only: This skips building gRPC Core and its
# dependencies, including protobuf and boringssl. This allows "incremental" # dependencies, including protobuf and boringssl. This allows "incremental"
# compilation by first building gRPC Core using make, then building only the # compilation by first building gRPC Core using make, then building only the
@ -258,6 +263,10 @@ if BUILD_WITH_SYSTEM_CARES:
CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES) CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES)
CARES_INCLUDE = (os.path.join('/usr', 'include'),) CARES_INCLUDE = (os.path.join('/usr', 'include'),)
if BUILD_WITH_SYSTEM_RE2:
CORE_C_FILES = filter(lambda x: 'third_party/re2' not in x, CORE_C_FILES)
RE2_INCLUDE = (os.path.join('/usr', 'include', 're2'),)
EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE + EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE +
ADDRESS_SORTING_INCLUDE + CARES_INCLUDE + ADDRESS_SORTING_INCLUDE + CARES_INCLUDE +
RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE + RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE +
@ -284,6 +293,8 @@ if BUILD_WITH_SYSTEM_ZLIB:
EXTENSION_LIBRARIES += ('z',) EXTENSION_LIBRARIES += ('z',)
if BUILD_WITH_SYSTEM_CARES: if BUILD_WITH_SYSTEM_CARES:
EXTENSION_LIBRARIES += ('cares',) EXTENSION_LIBRARIES += ('cares',)
if BUILD_WITH_SYSTEM_RE2:
EXTENSION_LIBRARIES += ('re2',)
DEFINE_MACROS = (('_WIN32_WINNT', 0x600),) DEFINE_MACROS = (('_WIN32_WINNT', 0x600),)
asm_files = [] asm_files = []

Loading…
Cancel
Save