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

Unified Diff: test/lib/TestGyp.py

Issue 9433026: Add Windows ninja to buildbot (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: again Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « buildbot/buildbot_run.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/lib/TestGyp.py
===================================================================
--- test/lib/TestGyp.py (revision 1224)
+++ test/lib/TestGyp.py (working copy)
@@ -419,6 +419,24 @@
ALL = 'all'
DEFAULT = 'all'
+ def initialize_build_tool(self):
+ super(TestGypNinja, self).initialize_build_tool()
+ if sys.platform == 'win32':
+ # Compiler and linker aren't in the path by default on Windows, so we
+ # make our "build tool" be set up + run ninja.
Nico 2012/02/22 05:17:58 Could you share code with TestGypMSVS.initialize_b
scottmg 2012/02/22 05:59:09 Yeah... That code seems kinda busted but I was too
+ vspath = 'Microsoft Visual Studio 9.0\\Common7\\Tools\\vsvars32.bat'
+ msvs_version = os.environ.get('GYP_MSVS_VERSION')
+ if msvs_version == '2010':
+ vspath = 'Microsoft Visual Studio 10.0\\Common7\\Tools\\vsvars32.bat'
+ path_root = os.environ.get('PROGRAMFILES')
+ full_path = os.path.join(path_root, vspath)
+ if os.path.exists(full_path):
+ self.build_tool = os.environ.get('COMSPEC', 'cmd.exe')
+ self.helper_args = ['/c', full_path, '&&', 'ninja']
+ else:
+ # Couldn't find setup, try just running default build_tool anyway.
+ self.helper_args = []
+
def run_gyp(self, gyp_file, *args, **kw):
TestGypBase.run_gyp(self, gyp_file, *args, **kw)
@@ -433,6 +451,9 @@
target = 'all'
arguments.append(target)
+ if sys.platform == 'win32':
+ arguments = self.helper_args + arguments
+
kw['arguments'] = arguments
return self.run(program=self.build_tool, **kw)
« no previous file with comments | « buildbot/buildbot_run.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698