summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-08 15:40:13 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-18 11:44:33 +0530
commitf781df7d060c809faa54bcbcafa1d02b36723aa4 (patch)
treee1f782eebf357f19af0e777c256d6d920733c5c9 /config
parentf541eb209f9e253ea96a0acf241605722956e3ef (diff)
darwin.config: Simplify SDK root detection
xcodebuild takes a 'Path' argument that directly gives us that path
Diffstat (limited to 'config')
-rw-r--r--config/darwin.config12
1 files changed, 5 insertions, 7 deletions
diff --git a/config/darwin.config b/config/darwin.config
index df98fe13..775fcfe9 100644
--- a/config/darwin.config
+++ b/config/darwin.config
@@ -29,16 +29,14 @@ if osx_target_sdk_version is not None:
sdk_requested_version = osx_target_sdk_version
sdk_root = None
-ret = shell.check_call('xcodebuild -sdk macosx%s -version' % sdk_requested_version).split('\n')
-sdk_path_prefix = 'Path: '
-sdk_path_line = [x for x in ret if x.startswith(sdk_path_prefix)]
-if sdk_path_line:
- sdk_root = str(sdk_path_line[0][len(sdk_path_prefix):])
+ret = shell.check_call('xcodebuild -sdk macosx%s -version Path' % sdk_requested_version).strip()
+if ret.startswith('/Applications'):
+ sdk_root = ret
if sdk_root is None:
- raise FatalError("Could not determine SDK path with requested version %s" % sdk_requested_version)
+ raise FatalError("Could not determine SDK path with requested version %s: %s" % (sdk_requested_version, ret))
elif not os.path.exists(sdk_root):
- raise FatalError("Determined SDK path %s does not exist. Is your Xcode installatio broken?" % sdk_root);
+ raise FatalError("Determined SDK path %s does not exist. Is your XCode installation broken?" % sdk_root);
min_osx_sdk_version = min_osx_sdk_version or '10.8'
sdk='-mmacosx-version-min=%s -isysroot %s' % (min_osx_sdk_version, sdk_root)