summaryrefslogtreecommitdiffstats
path: root/build/win/install-build-deps.py
diff options
context:
space:
mode:
authorscottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 23:00:06 +0000
committerscottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 23:00:06 +0000
commit5b6fd191b5de01c51d46214db35ad36ebe552fd7 (patch)
tree36c987a484cf802aa560835e0682db2b1ca5eb23 /build/win/install-build-deps.py
parent4549b4024337d6824c8c5a8a9705cf61341b8f28 (diff)
downloadchromium_src-5b6fd191b5de01c51d46214db35ad36ebe552fd7.zip
chromium_src-5b6fd191b5de01c51d46214db35ad36ebe552fd7.tar.gz
chromium_src-5b6fd191b5de01c51d46214db35ad36ebe552fd7.tar.bz2
Add install-build-deps.py to patch msbuild for vs2010
(patch discussed in bug and on connect page) BUG=97534 Review URL: https://chromiumcodereview.appspot.com/9265019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118381 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/win/install-build-deps.py')
-rw-r--r--build/win/install-build-deps.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/build/win/install-build-deps.py b/build/win/install-build-deps.py
new file mode 100644
index 0000000..d9e50b6
--- /dev/null
+++ b/build/win/install-build-deps.py
@@ -0,0 +1,47 @@
+#!/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.
+
+import shutil
+import sys
+import os
+
+def patch_msbuild():
+ """VS2010 MSBuild has a ULDI bug that we patch here. See http://goo.gl/Pn8tj.
+ """
+ source_path = os.path.join(os.environ['ProgramFiles(x86)'],
+ "MSBuild",
+ "Microsoft.Cpp",
+ "v4.0",
+ "Microsoft.CppBuild.targets")
+ backup_path = source_path + ".backup"
+ if not os.path.exists(backup_path):
+ try:
+ print "Backing up %s..." % source_path
+ shutil.copyfile(source_path, backup_path)
+ except IOError:
+ print "Could not back up %s to %s. Run as Administrator?" % (
+ source_path, backup_path)
+ return 1
+
+ source = open(source_path).read()
+ base = ('''<Target Name="GetResolvedLinkObjs" Returns="@(ObjFullPath)" '''
+ '''DependsOnTargets="$(CommonBuildOnlyTargets);ComputeCLOutputs;'''
+ '''ResolvedLinkObjs"''')
+ find = base + '>'
+ replace = base + ''' Condition="'$(ConfigurationType)'=='StaticLibrary'">'''
+ result = source.replace(find, replace)
+
+ if result != source:
+ open(source_path, "w").write(result)
+ print "Patched %s." % source_path
+ return 0
+
+
+def main():
+ return patch_msbuild()
+
+
+if __name__ == "__main__":
+ sys.exit(main())