Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Unified Diff: build/config/mac/sdk_info.py

Issue 1993653002: [GN] Use "xcrun" instead of "xcodebuild" to get information on SDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-gn-check-ios
Patch Set: Add a TODO to remove check for Xcode version later Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/mac/sdk_info.py
diff --git a/build/config/mac/sdk_info.py b/build/config/mac/sdk_info.py
index ad4ad9e98975d8b7d38c60696ed9d7fa5305b196..9a7d57a85f23dd7ba19762680e35c6b7d73a5b68 100644
--- a/build/config/mac/sdk_info.py
+++ b/build/config/mac/sdk_info.py
@@ -33,13 +33,19 @@ def FillMachineOSBuild(settings):
['sw_vers', '-buildVersion']).strip()
-def FillSDKPathAndVersion(settings, platform):
+def FillSDKPathAndVersion(settings, platform, xcode_version):
"""Fills the SDK path and version for |platform| into |settings|."""
- lines = subprocess.check_output(['xcodebuild', '-version', '-sdk',
- platform, 'Path', 'SDKVersion', 'ProductBuildVersion']).splitlines()
- settings['sdk_path'] = lines[0]
- settings['sdk_version'] = lines[1]
- settings['sdk_build'] = lines[2]
+ settings['sdk_path'] = subprocess.check_output([
+ 'xcrun', '-sdk', platform, '--show-sdk-path']).strip()
+ settings['sdk_version'] = subprocess.check_output([
+ 'xcrun', '-sdk', platform, '--show-sdk-version']).strip()
+ # TODO: unconditionally use --show-sdk-build-version once Xcode 7.2 or
+ # higher is required to build Chrome for iOS or OS X.
+ if xcode_version >= '0720':
+ settings['sdk_build'] = subprocess.check_output([
+ 'xcrun', '-sdk', platform, '--show-sdk-build-version']).strip()
+ else:
+ settings['sdk_build'] = settings['sdk_version']
if __name__ == '__main__':
@@ -50,9 +56,9 @@ if __name__ == '__main__':
sys.exit(1)
settings = {}
- FillSDKPathAndVersion(settings, sys.argv[1])
FillMachineOSBuild(settings)
FillXcodeVersion(settings)
+ FillSDKPathAndVersion(settings, sys.argv[1], settings['xcode_version'])
for key in sorted(settings):
print '%s="%s"' % (key, settings[key])
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698