Skip to content

Commit

Permalink
Added macOS SDK install path to library and include dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Oct 13, 2020
1 parent 4658c05 commit 928e5c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,18 @@ def build_extensions(self):
_add_directory(library_dirs, "/usr/X11/lib")
_add_directory(include_dirs, "/usr/X11/include")

# SDK install path
try:
sdk_path = (
subprocess.check_output(["xcrun", "--show-sdk-path"])
.strip()
.decode("latin1")
)
except Exception:
sdk_path = None
if sdk_path:
_add_directory(library_dirs, os.path.join(sdk_path, "usr", "lib"))
_add_directory(include_dirs, os.path.join(sdk_path, "usr", "include"))
elif (
sys.platform.startswith("linux")
or sys.platform.startswith("gnu")
Expand Down

0 comments on commit 928e5c6

Please sign in to comment.