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

Unified Diff: build/mac/find_sdk.py

Issue 10876003: mac: Print an error when doing a branded build and the 10.6 sdk is not around (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: doh Created 8 years, 4 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 | « build/common.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/mac/find_sdk.py
diff --git a/build/mac/find_sdk.py b/build/mac/find_sdk.py
index cbc36d3bee930c381385c40855e56404b3421c52..0b19c3024316fbfdd0e1fb229f6b176c3ab65b40 100755
--- a/build/mac/find_sdk.py
+++ b/build/mac/find_sdk.py
@@ -15,12 +15,22 @@ Usage:
python find_sdk.py 10.6 # Ignores SDKs < 10.6
"""
+from optparse import OptionParser
+
+
def parse_version(version_str):
"""'10.6' => [10, 6]"""
return map(int, re.findall(r'(\d+)', version_str))
-def main(min_sdk_version):
+def main():
+ parser = OptionParser()
+ parser.add_option("--verify",
+ action="store_true", dest="verify", default=False,
+ help="return the sdk argument and warn if it doesn't exist")
+ (options, args) = parser.parse_args()
+ min_sdk_version = args[0]
+
job = subprocess.Popen(['xcode-select', '-print-path'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
@@ -44,10 +54,26 @@ def main(min_sdk_version):
if parse_version(s) >= parse_version(min_sdk_version)]
if not sdks:
raise Exception('No %s+ SDK found' % min_sdk_version)
- print sorted(sdks, key=parse_version)[0]
+ best_sdk = sorted(sdks, key=parse_version)[0]
+
+ if options.verify and best_sdk != min_sdk_version:
+ print >>sys.stderr, ''
+ print >>sys.stderr, ' vvvvvvv'
+ print >>sys.stderr, ''
+ print >>sys.stderr, \
+ 'This build requires the %s SDK, but it was not found on your system.' \
+ % min_sdk_version
+ print >>sys.stderr, \
+ 'Either install it, or explicitly set mac_sdk in your GYP_DEFINES.'
+ print >>sys.stderr, ''
+ print >>sys.stderr, ' ^^^^^^^'
+ print >>sys.stderr, ''
+ return min_sdk_version
+
+ return best_sdk
if __name__ == '__main__':
if sys.platform != 'darwin':
raise Exception("This script only runs on Mac")
- main(min_sdk_version=sys.argv[1])
+ print main()
« no previous file with comments | « build/common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698