| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import subprocess | 6 import subprocess |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 # This script prints information about the build system, the operating | 9 # This script prints information about the build system, the operating |
| 10 # system and the iOS or Mac SDK (depending on the platform "iphonesimulator", | 10 # system and the iOS or Mac SDK (depending on the platform "iphonesimulator", |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 settings['machine_os_build'] = subprocess.check_output( | 32 settings['machine_os_build'] = subprocess.check_output( |
| 33 ['sw_vers', '-buildVersion']).strip() | 33 ['sw_vers', '-buildVersion']).strip() |
| 34 | 34 |
| 35 | 35 |
| 36 def FillSDKPathAndVersion(settings, platform, xcode_version): | 36 def FillSDKPathAndVersion(settings, platform, xcode_version): |
| 37 """Fills the SDK path and version for |platform| into |settings|.""" | 37 """Fills the SDK path and version for |platform| into |settings|.""" |
| 38 settings['sdk_path'] = subprocess.check_output([ | 38 settings['sdk_path'] = subprocess.check_output([ |
| 39 'xcrun', '-sdk', platform, '--show-sdk-path']).strip() | 39 'xcrun', '-sdk', platform, '--show-sdk-path']).strip() |
| 40 settings['sdk_version'] = subprocess.check_output([ | 40 settings['sdk_version'] = subprocess.check_output([ |
| 41 'xcrun', '-sdk', platform, '--show-sdk-version']).strip() | 41 'xcrun', '-sdk', platform, '--show-sdk-version']).strip() |
| 42 settings['sdk_platform_path'] = subprocess.check_output([ |
| 43 'xcrun', '-sdk', platform, '--show-sdk-platform-path']).strip() |
| 42 # TODO: unconditionally use --show-sdk-build-version once Xcode 7.2 or | 44 # TODO: unconditionally use --show-sdk-build-version once Xcode 7.2 or |
| 43 # higher is required to build Chrome for iOS or OS X. | 45 # higher is required to build Chrome for iOS or OS X. |
| 44 if xcode_version >= '0720': | 46 if xcode_version >= '0720': |
| 45 settings['sdk_build'] = subprocess.check_output([ | 47 settings['sdk_build'] = subprocess.check_output([ |
| 46 'xcrun', '-sdk', platform, '--show-sdk-build-version']).strip() | 48 'xcrun', '-sdk', platform, '--show-sdk-build-version']).strip() |
| 47 else: | 49 else: |
| 48 settings['sdk_build'] = settings['sdk_version'] | 50 settings['sdk_build'] = settings['sdk_version'] |
| 49 | 51 |
| 50 | 52 |
| 51 if __name__ == '__main__': | 53 if __name__ == '__main__': |
| 52 if len(sys.argv) != 2: | 54 if len(sys.argv) != 2: |
| 53 sys.stderr.write( | 55 sys.stderr.write( |
| 54 'usage: %s [iphoneos|iphonesimulator|macosx]\n' % | 56 'usage: %s [iphoneos|iphonesimulator|macosx]\n' % |
| 55 os.path.basename(sys.argv[0])) | 57 os.path.basename(sys.argv[0])) |
| 56 sys.exit(1) | 58 sys.exit(1) |
| 57 | 59 |
| 58 settings = {} | 60 settings = {} |
| 59 FillMachineOSBuild(settings) | 61 FillMachineOSBuild(settings) |
| 60 FillXcodeVersion(settings) | 62 FillXcodeVersion(settings) |
| 61 FillSDKPathAndVersion(settings, sys.argv[1], settings['xcode_version']) | 63 FillSDKPathAndVersion(settings, sys.argv[1], settings['xcode_version']) |
| 62 | 64 |
| 63 for key in sorted(settings): | 65 for key in sorted(settings): |
| 64 print '%s="%s"' % (key, settings[key]) | 66 print '%s="%s"' % (key, settings[key]) |
| OLD | NEW |