From 90b29e267408ea5338d9a0c98aeb6100889f9201 Mon Sep 17 00:00:00 2001 From: Chris Hager Date: Wed, 24 Jan 2018 16:50:59 +0100 Subject: [PATCH] OSX support for 'pip install' --- setup.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 4da7daa..378a78e 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import platform from setuptools import setup from setuptools import find_packages from distutils.extension import Extension @@ -10,17 +11,22 @@ except ImportError: else: sources = ['rocksdb/_rocksdb.pyx'] +extra_compile_args = [ + '-std=c++11', + '-O3', + '-Wall', + '-Wextra', + '-Wconversion', + '-fno-strict-aliasing' +] + +if platform.system() == 'Darwin': + extra_compile_args += ['-mmacosx-version-min=10.7', '-stdlib=libc++'] + mod1 = Extension( 'rocksdb._rocksdb', sources, - extra_compile_args=[ - '-std=c++11', - '-O3', - '-Wall', - '-Wextra', - '-Wconversion', - '-fno-strict-aliasing' - ], + extra_compile_args=extra_compile_args, language='c++', libraries=[ 'rocksdb',