| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 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 | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """Script to check that the Windows 8 SDK has been appropriately patched so that | |
| 7 it can be used with VS 2010. | |
| 8 | |
| 9 In practice, this checks for the presence of 'enum class' in asyncinfo.h. | |
| 10 Changing that to 'enum' is the only thing needed to build with the WinRT | |
| 11 headers in VS 2010. | |
| 12 """ | |
| 13 | |
| 14 import os | |
| 15 import sys | |
| 16 | |
| 17 | |
| 18 def main(argv): | |
| 19 if len(argv) < 2: | |
| 20 print "Usage: check_sdk_patch.py path_to_windows_8_sdk [dummy_output_file]" | |
| 21 return 1 | |
| 22 | |
| 23 # Look for asyncinfo.h | |
| 24 async_info_path = os.path.join(argv[1], 'Include/winrt/asyncinfo.h') | |
| 25 if not os.path.exists(async_info_path): | |
| 26 print ("Could not find %s in provided SDK path. Please check input." % | |
| 27 async_info_path) | |
| 28 print "CWD: %s" % os.getcwd() | |
| 29 return 2 | |
| 30 else: | |
| 31 if 'enum class' in open(async_info_path).read(): | |
| 32 print ("\nERROR: You are using an unpatched Windows 8 SDK located at %s." | |
| 33 "\nPlease see instructions at" | |
| 34 "\nhttp://www.chromium.org/developers/how-tos/" | |
| 35 "build-instructions-windows\nfor how to apply the patch to build " | |
| 36 "with VS2010.\n" % argv[1]) | |
| 37 return 3 | |
| 38 else: | |
| 39 if len(argv) > 2: | |
| 40 with open(argv[2], 'w') as dummy_file: | |
| 41 dummy_file.write('Windows 8 SDK has been patched!') | |
| 42 | |
| 43 # Patched Windows 8 SDK found. | |
| 44 return 0 | |
| 45 | |
| 46 | |
| 47 if '__main__' == __name__: | |
| 48 sys.exit(main(sys.argv)) | |
| OLD | NEW |