| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Prints the lowest locally available SDK version greater than or equal to a | 6 """Prints the lowest locally available SDK version greater than or equal to a |
| 7 given minimum sdk version to standard output. | 7 given minimum sdk version to standard output. |
| 8 | 8 |
| 9 Usage: | 9 Usage: |
| 10 python find_sdk.py 10.6 # Ignores SDKs < 10.6 | 10 python find_sdk.py 10.6 # Ignores SDKs < 10.6 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 print >> sys.stderr, ' vvvvvvv' | 68 print >> sys.stderr, ' vvvvvvv' |
| 69 print >> sys.stderr, '' | 69 print >> sys.stderr, '' |
| 70 print >> sys.stderr, \ | 70 print >> sys.stderr, \ |
| 71 'This build requires the %s SDK, but it was not found on your system.' \ | 71 'This build requires the %s SDK, but it was not found on your system.' \ |
| 72 % min_sdk_version | 72 % min_sdk_version |
| 73 print >> sys.stderr, \ | 73 print >> sys.stderr, \ |
| 74 'Either install it, or explicitly set mac_sdk in your GYP_DEFINES.' | 74 'Either install it, or explicitly set mac_sdk in your GYP_DEFINES.' |
| 75 print >> sys.stderr, '' | 75 print >> sys.stderr, '' |
| 76 print >> sys.stderr, ' ^^^^^^^' | 76 print >> sys.stderr, ' ^^^^^^^' |
| 77 print >> sys.stderr, '' | 77 print >> sys.stderr, '' |
| 78 return min_sdk_version | 78 sys.exit(1) |
| 79 | 79 |
| 80 if options.print_sdk_path: | 80 if options.print_sdk_path: |
| 81 print subprocess.check_output( | 81 print subprocess.check_output( |
| 82 ['xcrun', '-sdk', 'macosx' + best_sdk, '--show-sdk-path']).strip() | 82 ['xcrun', '-sdk', 'macosx' + best_sdk, '--show-sdk-path']).strip() |
| 83 | 83 |
| 84 return best_sdk | 84 return best_sdk |
| 85 | 85 |
| 86 | 86 |
| 87 if __name__ == '__main__': | 87 if __name__ == '__main__': |
| 88 if sys.platform != 'darwin': | 88 if sys.platform != 'darwin': |
| 89 raise Exception("This script only runs on Mac") | 89 raise Exception("This script only runs on Mac") |
| 90 print main() | 90 print main() |
| 91 sys.exit(0) | 91 sys.exit(0) |
| OLD | NEW |