mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-25 00:34:14 +03:00
Only prefer command line tools SDK on macOS over the default
This commit is contained in:
parent
24f0bbf5ec
commit
3b701dcc16
28
setup.py
28
setup.py
|
@ -532,16 +532,24 @@ class pil_build_ext(build_ext):
|
||||||
_add_directory(include_dirs, "/usr/X11/include")
|
_add_directory(include_dirs, "/usr/X11/include")
|
||||||
|
|
||||||
# SDK install path
|
# SDK install path
|
||||||
sdk_path = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
|
try:
|
||||||
if not os.path.exists(sdk_path):
|
sdk_path = (
|
||||||
try:
|
subprocess.check_output(["xcrun", "--show-sdk-path"])
|
||||||
sdk_path = (
|
.strip()
|
||||||
subprocess.check_output(["xcrun", "--show-sdk-path"])
|
.decode("latin1")
|
||||||
.strip()
|
)
|
||||||
.decode("latin1")
|
except Exception:
|
||||||
)
|
sdk_path = None
|
||||||
except Exception:
|
if (
|
||||||
sdk_path = None
|
not sdk_path
|
||||||
|
or sdk_path == "/Applications/Xcode.app/Contents/Developer"
|
||||||
|
"/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
||||||
|
):
|
||||||
|
commandlinetools_sdk_path = (
|
||||||
|
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
|
||||||
|
)
|
||||||
|
if os.path.exists(commandlinetools_sdk_path):
|
||||||
|
sdk_path = commandlinetools_sdk_path
|
||||||
if sdk_path:
|
if sdk_path:
|
||||||
_add_directory(library_dirs, os.path.join(sdk_path, "usr", "lib"))
|
_add_directory(library_dirs, os.path.join(sdk_path, "usr", "lib"))
|
||||||
_add_directory(include_dirs, os.path.join(sdk_path, "usr", "include"))
|
_add_directory(include_dirs, os.path.join(sdk_path, "usr", "include"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user