diff --git a/Tools/NativeHost/Jakefile b/Tools/NativeHost/Jakefile index a092ea137..8df9bce4b 100644 --- a/Tools/NativeHost/Jakefile +++ b/Tools/NativeHost/Jakefile @@ -11,7 +11,7 @@ task ("build", function() { var args = "-alltargets -configuration Release"; - if (FILE.exists(FILE.join("/", "Developer", "SDKs", "MacOSX10.5.sdk"))) + if (xcodebuildHasTenPointFiveSDK()) args = "-sdk macosx10.5 " + args; else diff --git a/Tools/fontinfo/Jakefile b/Tools/fontinfo/Jakefile index 4ab6d6c6e..38d02b91c 100644 --- a/Tools/fontinfo/Jakefile +++ b/Tools/fontinfo/Jakefile @@ -10,7 +10,7 @@ task ("build", function() { var args = "-alltargets -configuration " + $CONFIGURATION; - if (FILE.exists(FILE.join("/", "Developer", "SDKs", "MacOSX10.5.sdk"))) + if (xcodebuildHasTenPointFiveSDK()) args = "-sdk macosx10.5 " + args; else diff --git a/common.jake b/common.jake index f1fa62f74..9331f5dba 100644 --- a/common.jake +++ b/common.jake @@ -456,6 +456,21 @@ global.copyManPage = function(/*String*/ name, /*int*/ section) } } +global.xcodebuildCanListSDKs = function () +{ + return OS.system("xcodebuild -showsdks > /dev/null 2>&1") == 0; +} + +global.xcodebuildHasTenPointFiveSDK = function () +{ + if (xcodebuildCanListSDKs()) { + return OS.system("xcodebuild -showsdks | grep 'macosx10.5' > /dev/null 2>&1") == 0; + } else { + return (FILE.exists(FILE.join("/", "Developer", "SDKs", "MacOSX10.5.sdk"))); + } +} + + // built in tasks