Skip to content

Commit

Permalink
set environment variable MACOSX_DEPLOYMENT_TARGET to be consistent wi…
Browse files Browse the repository at this point in the history
…th `-stdlib=libc++`

Summary: On OS X, it shouldn't be necessary to manually set the variable `MACOSX_DEPLOYMENT_TARGET` when installing python bindings.

Reviewed By: EdouardGrave

Differential Revision: D14726033

fbshipit-source-id: 6583650c03f1a2c5da6922d70ca8eb90df89e5ef
  • Loading branch information
Celebio authored and facebook-github-bot committed Apr 4, 2019
1 parent 36b147d commit ebf8074
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import setuptools
import os
import subprocess
import platform

__version__ = '0.8.22'
FASTTEXT_SRC = "src"
Expand Down Expand Up @@ -118,6 +119,8 @@ class BuildExt(build_ext):

def build_extensions(self):
if sys.platform == 'darwin':
mac_osx_version = float('.'.join(platform.mac_ver()[0].split('.')[:2]))
os.environ['MACOSX_DEPLOYMENT_TARGET'] = str(mac_osx_version)
all_flags = ['-stdlib=libc++', '-mmacosx-version-min=10.7']
if has_flag(self.compiler, [all_flags[0]]):
self.c_opts['unix'] += [all_flags[0]]
Expand Down

0 comments on commit ebf8074

Please sign in to comment.