Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: build/win/install-build-deps.py

Issue 9265019: Add install-build-deps.py to patch msbuild for vs2010 (Closed)
Patch Set: fixes Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 import shutil
7 import sys
8 import os
9
10 def patch_msbuild():
11 """VS2010 MSBuild has a ULDI bug that we patch here. See http://goo.gl/Pn8tj.
12 """
13 source_path = os.path.join(os.environ['ProgramFiles(x86)'],
14 "MSBuild",
15 "Microsoft.Cpp",
16 "v4.0",
17 "Microsoft.CppBuild.targets")
18 backup_path = source_path + ".backup"
19 if not os.path.exists(backup_path):
20 try:
21 print "Backing up %s..." % source_path
22 shutil.copyfile(source_path, backup_path)
23 except IOError:
24 print "Could not back up %s to %s. Run as Administrator?" % (
25 source_path, backup_path)
26 return 1
27
28 source = open(source_path).read()
29 base = ('''<Target Name="GetResolvedLinkObjs" Returns="@(ObjFullPath)" '''
30 '''DependsOnTargets="$(CommonBuildOnlyTargets);ComputeCLOutputs;'''
31 '''ResolvedLinkObjs"''')
32 find = base + '>'
33 replace = base + ''' Condition="'$(ConfigurationType)'=='StaticLibrary'">'''
34 result = source.replace(find, replace)
35
36 if result != source:
37 open(source_path, "w").write(result)
38 print "Patched %s." % source_path
39 return 0
40
41
42 def main():
43 return patch_msbuild()
44
45
46 if __name__ == "__main__":
47 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698