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

Unified Diff: ninja.bat

Issue 9967020: Wrap ninja invocation to include python in path, and set up compiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 8 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 | « no previous file | ninja.exe » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ninja.bat
===================================================================
--- ninja.bat (revision 0)
+++ ninja.bat (revision 0)
@@ -0,0 +1,42 @@
+@echo off
+
+:: Copyright (c) 2012 Google Inc. All rights reserved.
+:: Use of this source code is governed by a BSD-style license that can be
+:: found in the LICENSE file.
+
+setlocal enabledelayedexpansion
+
+:: Parse args to see if a -C argument (to change working directory) is being
+:: supplied. We expect project generation to output a set_environment.bat that
+:: will set up the environment (variables and path). This script generally
+:: just calls the correct VS vars batch file, but only gyp has the knowledge
+:: to determine which version of the IDE/toolchain it wants to use, so we have
+:: to defer to it to make that decision.
+set found_dash_c=0
+set cd_path=.
+for %%A in (%*) do (
+ if "!found_dash_c!"=="1" (
+ set cd_path=%%A
+ goto done_dash_c
+ )
+ if "%%A"=="-C" (
+ set found_dash_c=1
+ )
+)
+:done_dash_c
+
+if not exist "%cd_path%\set_environment.bat" (
+ echo ninja.bat: set_environment.bat not found in '%cd_path%'. Is -C arg correct?
+ goto :EOF
+)
+call "%cd_path%\set_environment.bat"
+
+:: Add python to the path, many gyp rules assume it's there.
+:: Add ninja directory to the path (to find ninja and ninja-deplist-helper).
+:: Then, export only the path changes out of the script so that next time we
+:: just run ninja directly (otherwise, this script adds about 500-800ms to
+:: ninja invocations).
+endlocal & set PATH=%~dp0python_bin;%~dp0ninja-win;%PATH% & set INCLUDE=%INCLUDE% & set LIBPATH=%LIBPATH% & set LIB=%LIB%
+
+:: Now run the actual build.
+ninja.exe %*
Property changes on: ninja.bat
___________________________________________________________________
Added: svn:eol-style
+ CRLF
« no previous file with comments | « no previous file | ninja.exe » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698