Windows + mac dbg fix

pull/10676/head
Ken Payson 8 years ago
parent 1f24b2ad8a
commit 5b034e6a4f
  1. 14
      setup.py
  2. 5
      src/python/grpcio/commands.py

@ -113,7 +113,7 @@ if EXTRA_ENV_COMPILE_ARGS is None:
else: else:
EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime64 -D_timeb=__timeb64' EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime64 -D_timeb=__timeb64'
elif 'win32' in sys.platform: elif 'win32' in sys.platform:
EXTRA_ENV_COMPILE_ARGS += ' -D_PYTHON_MSVC' EXTRA_ENV_COMPILE_ARGS += ' -D_PYTHON_MSVC -std=c++11'
elif "linux" in sys.platform: elif "linux" in sys.platform:
EXTRA_ENV_COMPILE_ARGS += ' -std=c++11 -fvisibility=hidden -fno-wrapv' EXTRA_ENV_COMPILE_ARGS += ' -std=c++11 -fvisibility=hidden -fno-wrapv'
elif "darwin" in sys.platform: elif "darwin" in sys.platform:
@ -194,11 +194,15 @@ def cython_extensions_and_necessity():
cython_module_files = [os.path.join(PYTHON_STEM, cython_module_files = [os.path.join(PYTHON_STEM,
name.replace('.', '/') + '.pyx') name.replace('.', '/') + '.pyx')
for name in CYTHON_EXTENSION_MODULE_NAMES] for name in CYTHON_EXTENSION_MODULE_NAMES]
config = os.environ['CONFIG']
if config is None:
config = 'opt'
prefix = 'libs/' + config + '/'
if "darwin" in sys.platform: if "darwin" in sys.platform:
extra_objects = ['libs/opt/libares.a', extra_objects = [prefix + 'libares.a',
'libs/opt/libboringssl.a', prefix + 'libboringssl.a',
'libs/opt/libgpr.a', prefix + 'libgpr.a',
'libs/opt/libgrpc.a'] prefix + 'libgrpc.a']
core_c_files = [] core_c_files = []
else: else:
core_c_files = list(CORE_C_FILES) core_c_files = list(CORE_C_FILES)

@ -267,9 +267,12 @@ class BuildExt(build_ext.build_ext):
def build_extensions(self): def build_extensions(self):
if "darwin" in sys.platform: if "darwin" in sys.platform:
config = os.environ['CONFIG']
if config is None:
config = 'opt'
target_path = os.path.abspath( target_path = os.path.abspath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.join(os.path.dirname(os.path.realpath(__file__)),
'..', '..', '..', 'libs', 'opt')) '..', '..', '..', 'libs', config))
targets = [os.path.join(target_path, 'libboringssl.a'), targets = [os.path.join(target_path, 'libboringssl.a'),
os.path.join(target_path, 'libares.a'), os.path.join(target_path, 'libares.a'),
os.path.join(target_path, 'libgpr.a'), os.path.join(target_path, 'libgpr.a'),

Loading…
Cancel
Save