Skip to content

Commit

Permalink
Merge pull request #4974 from radarhere/sdk
Browse files Browse the repository at this point in the history
Added macOS SDK install path to library and include directories
  • Loading branch information
hugovk authored Oct 14, 2020
2 parents 2c0aa5d + 928e5c6 commit 1a66e2f
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 @@ -475,6 +475,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 1a66e2f

Please sign in to comment.