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.
6 """Script to check that the Windows 8 SDK has been appropriately patched so that
7 it can be used with VS 2010.
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
20 print "Usage: check_sdk_patch.py path_to_windows_8_sdk [dummy_output_file]"
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." %
28 print "CWD: %s" % os.getcwd()
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])
40 with open(argv[2], 'w') as dummy_file:
41 dummy_file.write('Windows 8 SDK has been patched!')
43 # Patched Windows 8 SDK found.
47 if '__main__' == __name__:
48 sys.exit(main(sys.argv))