summaryrefslogtreecommitdiffstats
path: root/build/mac
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-22 21:45:59 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-22 21:45:59 +0000
commit0b6543e0a8f551de6e7664fe0de6ce53f4612fd7 (patch)
tree6fcf12674118a51468740959a52cfb2339835a37 /build/mac
parent849a011cf29cf87ee2b7a0842f78e79a16e790ba (diff)
downloadchromium_src-0b6543e0a8f551de6e7664fe0de6ce53f4612fd7.zip
chromium_src-0b6543e0a8f551de6e7664fe0de6ce53f4612fd7.tar.gz
chromium_src-0b6543e0a8f551de6e7664fe0de6ce53f4612fd7.tar.bz2
mac: Print an error when doing a branded build and the 10.6 sdk is not around
BUG=144045 Review URL: https://chromiumcodereview.appspot.com/10876003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/mac')
-rwxr-xr-xbuild/mac/find_sdk.py32
1 files changed, 29 insertions, 3 deletions
diff --git a/build/mac/find_sdk.py b/build/mac/find_sdk.py
index cbc36d3b..0b19c30 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()