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: http://src.chromium.org/svn/trunk/src/build@152823 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
Родитель
2ac284c40c
Коммит
2e8dc935df
|
@ -1034,7 +1034,7 @@
|
||||||
}],
|
}],
|
||||||
|
|
||||||
['branding=="Chrome" and buildtype=="Official"', {
|
['branding=="Chrome" and buildtype=="Official"', {
|
||||||
'mac_sdk%': '10.6',
|
'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify 10.6)',
|
||||||
# Enable uploading crash dumps.
|
# Enable uploading crash dumps.
|
||||||
'mac_breakpad_uploads%': 1,
|
'mac_breakpad_uploads%': 1,
|
||||||
# Enable dumping symbols at build time for use by Mac Breakpad.
|
# Enable dumping symbols at build time for use by Mac Breakpad.
|
||||||
|
|
|
@ -15,12 +15,22 @@ Usage:
|
||||||
python find_sdk.py 10.6 # Ignores SDKs < 10.6
|
python find_sdk.py 10.6 # Ignores SDKs < 10.6
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
|
||||||
def parse_version(version_str):
|
def parse_version(version_str):
|
||||||
"""'10.6' => [10, 6]"""
|
"""'10.6' => [10, 6]"""
|
||||||
return map(int, re.findall(r'(\d+)', version_str))
|
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'],
|
job = subprocess.Popen(['xcode-select', '-print-path'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT)
|
||||||
|
@ -44,10 +54,26 @@ def main(min_sdk_version):
|
||||||
if parse_version(s) >= parse_version(min_sdk_version)]
|
if parse_version(s) >= parse_version(min_sdk_version)]
|
||||||
if not sdks:
|
if not sdks:
|
||||||
raise Exception('No %s+ SDK found' % min_sdk_version)
|
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 __name__ == '__main__':
|
||||||
if sys.platform != 'darwin':
|
if sys.platform != 'darwin':
|
||||||
raise Exception("This script only runs on Mac")
|
raise Exception("This script only runs on Mac")
|
||||||
main(min_sdk_version=sys.argv[1])
|
print main()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче