Skip to content

Commit

Permalink
Setup / osx: use libc++ to compile the extension
Browse files Browse the repository at this point in the history
Xcode 10 requires the use of the libc++ standard library.
  • Loading branch information
Linkid committed Apr 10, 2020
1 parent b1635d7 commit 773c565
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Release notes
- Setup: correctly use the relative path of the README file
- Setup: declare 'docs' extra for the documentation
- Setup: declare 'tests' extra for tests
- Setup / osx: use libc++ to compile the extension (xcode >= 10)
- Tests: restrict the pytest version (< 5)


Expand Down
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@
]

# extension
extra_compile_args_pitch = list()
extra_link_args_pitch = list()
if sys.platform.startswith("darwin"):
# hack: with mac os version 10.13.6 (high sierra), xcode 10 requires the use of the libc++ standard library
extra_compile_args_pitch.extend(["-stdlib=libc++", "-mmacosx-version-min=10.9"])
extra_link_args_pitch.extend(["-stdlib=libc++", "-mmacosx-version-min=10.9"])

ext = Extension(
name='pypitch.pypitch',
sources=ext_sources,
language='c++',
extra_compile_args=extra_compile_args_pitch,
extra_link_args=extra_link_args_pitch,
)

# setup
Expand Down

0 comments on commit 773c565

Please sign in to comment.