diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 00:24:53 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 00:24:53 +0000 |
commit | a8473d9ff0b710b676020ad78b2d9121e152d7bf (patch) | |
tree | 3b4797d08e7a3562f02f3c9e2330db0004dac92d /win8 | |
parent | 29011bc23c865a039bb6f861af79649830b3190b (diff) | |
download | chromium_src-a8473d9ff0b710b676020ad78b2d9121e152d7bf.zip chromium_src-a8473d9ff0b710b676020ad78b2d9121e152d7bf.tar.gz chromium_src-a8473d9ff0b710b676020ad78b2d9121e152d7bf.tar.bz2 |
Move check_sdk_patch.py to win8/util.
It used to sit in chrome/tools/win/ which meant that, since webkit has to add win8/ to its dependencies for win8_util, it now had to also pull chrome/ :(...
NOTRY=True
BUG=151718 (see comment #25+).
Review URL: https://chromiumcodereview.appspot.com/11478013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171652 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rwxr-xr-x | win8/util/check_sdk_patch.py | 48 | ||||
-rw-r--r-- | win8/win8.gyp | 2 |
2 files changed, 49 insertions, 1 deletions
diff --git a/win8/util/check_sdk_patch.py b/win8/util/check_sdk_patch.py new file mode 100755 index 0000000..0a8cb9e --- /dev/null +++ b/win8/util/check_sdk_patch.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Script to check that the Windows 8 SDK has been appropriately patched so that + it can be used with VS 2010. + + In practice, this checks for the presence of 'enum class' in asyncinfo.h. + Changing that to 'enum' is the only thing needed to build with the WinRT + headers in VS 2010. +""" + +import os +import sys + + +def main(argv): + if len(argv) < 2: + print "Usage: check_sdk_patch.py path_to_windows_8_sdk [dummy_output_file]" + return 1 + + # Look for asyncinfo.h + async_info_path = os.path.join(argv[1], 'Include/winrt/asyncinfo.h') + if not os.path.exists(async_info_path): + print ("Could not find %s in provided SDK path. Please check input." % + async_info_path) + print "CWD: %s" % os.getcwd() + return 2 + else: + if 'enum class' in open(async_info_path).read(): + print ("\nERROR: You are using an unpatched Windows 8 SDK located at %s." + "\nPlease see instructions at" + "\nhttp://www.chromium.org/developers/how-tos/" + "build-instructions-windows\nfor how to apply the patch to build " + "with VS2010.\n" % argv[1]) + return 3 + else: + if len(argv) > 2: + with open(argv[2], 'w') as dummy_file: + dummy_file.write('Windows 8 SDK has been patched!') + + # Patched Windows 8 SDK found. + return 0 + + +if '__main__' == __name__: + sys.exit(main(sys.argv)) diff --git a/win8/win8.gyp b/win8/win8.gyp index a159588..d6ca61f 100644 --- a/win8/win8.gyp +++ b/win8/win8.gyp @@ -13,7 +13,7 @@ 'target_name': 'check_sdk_patch', 'type': 'none', 'variables': { - 'check_sdk_script': '<(DEPTH)/chrome/tools/build/win/check_sdk_patch.py', + 'check_sdk_script': 'util/check_sdk_patch.py', 'output_path': '<(INTERMEDIATE_DIR)/check_sdk_patch', }, 'actions': [ |