From 6895d58a5df067465000ea14684fe787778b2d54 Mon Sep 17 00:00:00 2001 From: R0uter Date: Wed, 20 May 2020 13:32:53 +1000 Subject: [PATCH] Fix for PyPy install `clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9` This error pops up only when install via pip_pypy, Python was fine, now both should work like a charm. Test before merge. --- setup.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6b4dfc45..6f4146b4 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages from setuptools import Extension - +import os extra_compile_args = [ '-std=c++11', @@ -14,10 +14,20 @@ '-fno-rtti', ] + if platform.system() == 'Darwin': extra_compile_args += ['-mmacosx-version-min=10.7', '-stdlib=libc++'] + from distutils.sysconfig import get_config_var + from distutils.version import LooseVersion + if 'MACOSX_DEPLOYMENT_TARGET' not in os.environ: + current_system = LooseVersion(platform.mac_ver()[0]) + python_target = LooseVersion( + get_config_var('MACOSX_DEPLOYMENT_TARGET')) + if python_target < '10.9' and current_system >= '10.9': + os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9' - + + setup( name="python-rocksdb", version='0.7.0',