Skip to content

Commit

Permalink
Fix locating stdlib on macos
Browse files Browse the repository at this point in the history
When compiling on mac with xcode 10 the standard library headers are not found.
This adds an extra compile and link option to find them.
  • Loading branch information
TheJasperV committed May 19, 2019
1 parent 2025f78 commit 7fae8c6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions setup.py
Expand Up @@ -26,7 +26,7 @@
import distutils.ccompiler
from distutils.dep_util import newer
from distutils.command.install import install as _install
import sys, glob, os, fnmatch
import sys, glob, os, fnmatch, platform
import subprocess
import shlex

Expand All @@ -35,6 +35,7 @@
from fofix.core import Version, SceneFactory

from setuptools import setup, Extension, Command
import pkg_resources
from Cython.Build import cythonize


Expand Down Expand Up @@ -462,11 +463,20 @@ def run(self):
else:
vidInclude = ['.']

extra_compile_args_pitch = [];
extra_link_args_pitch = [];
if os.uname()[0] == "Darwin" and pkg_resources.parse_version(os.uname()[2]) >= pkg_resources.parse_version("17.7.0"):
print("success")
extra_compile_args_pitch.append("-stdlib=libc++")
extra_link_args_pitch.append("-stdlib=libc++")

extensions = [
Extension('fofix.lib.cmgl', ['fofix/core/cmgl/cmgl.pyx'], **combine_info(numpy_info, gl_info)),
Extension('fofix.lib._pypitch',
language='c++',
sources=['fofix/core/pypitch/_pypitch.pyx', 'fofix/core/pypitch/pitch.cpp']),
sources=['fofix/core/pypitch/_pypitch.pyx', 'fofix/core/pypitch/pitch.cpp'],
extra_compile_args=extra_compile_args_pitch,
extra_link_args=extra_link_args_pitch),
Extension('fofix.lib._VideoPlayer',
['fofix/core/VideoPlayer/_VideoPlayer.pyx', 'fofix/core/VideoPlayer/VideoPlayer.c'],
**combine_info(gl_info, ogg_info, theoradec_info, glib_info, swscale_info,
Expand Down

0 comments on commit 7fae8c6

Please sign in to comment.