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" |
| 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. Please see " |
| 33 "instructions at\nhttp://www.chromium.org/developers/how-tos/" |
| 34 "build-instructions-windows\nfor how to apply the patch to build " |
| 35 "with VS2010.\n") |
| 36 return 3 |
| 37 else: |
| 38 # Patched Windows 8 SDK found. |
| 39 return 0 |
| 40 |
| 41 |
| 42 if '__main__' == __name__: |
| 43 sys.exit(main(sys.argv)) |
OLD | NEW |