Navigation Menu

Skip to content

Commit

Permalink
Fix build-time test for presence of Mac OS X 10.5 SDK
Browse files Browse the repository at this point in the history
Some jake build tasks test whether the 10.5 SDK is present, and if so, they build using it. However, the path to the SDK is not necessarily consistent across installations, so testing for path existence is not the best way to check whether the SDK is present. Doing it that way caused build failures on machines with both Xcode 3 and Xcode 4 installed. In this fix, we now ask xcodebuild what SDKs are present, and only fall back on the path existence test if the local copy of xcodebuild does not support listing SDKs (as is the case for old versions of xcodebuild).
  • Loading branch information
masonmark committed May 11, 2011
1 parent 48ccbb8 commit b84d721
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Tools/NativeHost/Jakefile
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tools/fontinfo/Jakefile
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions common.jake
Expand Up @@ -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

Expand Down

0 comments on commit b84d721

Please sign in to comment.