mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-30 01:53:17 +03:00
Fix SDK detection to work with modern versions of Xcode.
This finds the the OS X SDK directory by using xcrun and known fallbacks; users shouldn't be symlinking /Developer.
This commit is contained in:
parent
7dd2db25ec
commit
b644b1253d
@ -554,7 +554,24 @@ class InternalCommands:
|
|||||||
return (major, minor, rev)
|
return (major, minor, rev)
|
||||||
|
|
||||||
def getMacSdkDir(self):
|
def getMacSdkDir(self):
|
||||||
return "/Developer/SDKs/MacOSX" + self.macSdk + ".sdk"
|
sdkName = "macosx" + self.macSdk
|
||||||
|
|
||||||
|
# Ideally we'll use xcrun (which is influenced by $DEVELOPER_DIR), then try a couple
|
||||||
|
# fallbacks to known paths if xcrun is not available
|
||||||
|
status, sdkPath = commands.getstatusoutput("xcrun --show-sdk-path --sdk " + sdkName)
|
||||||
|
if status == 0 and sdkPath:
|
||||||
|
return sdkPath
|
||||||
|
|
||||||
|
developerDir = os.getenv("DEVELOPER_DIR")
|
||||||
|
if not developerDir:
|
||||||
|
developerDir = "/Applications/Xcode.app/Contents/Developer"
|
||||||
|
|
||||||
|
sdkDirName = sdkName.replace("macosx", "MacOSX")
|
||||||
|
sdkPath = developerDir + "/Platforms/MacOSX.platform/Developer/SDKs/" + sdkDirName + ".sdk"
|
||||||
|
if os.path.exists(sdkPath):
|
||||||
|
return sdkPath
|
||||||
|
|
||||||
|
return "/Developer/SDKs/" + sdkDirName + ".sdk"
|
||||||
|
|
||||||
# http://tinyurl.com/cs2rxxb
|
# http://tinyurl.com/cs2rxxb
|
||||||
def fixCmakeEclipseBug(self):
|
def fixCmakeEclipseBug(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user