From 928e5c6e8f183d86cf8219a2a56932e13f5064c4 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 14 Oct 2020 01:02:04 +1100 Subject: [PATCH] Added macOS SDK install path to library and include dirs --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 2f7c85e9b09..9095fe48454 100755 --- a/setup.py +++ b/setup.py @@ -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")