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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ninja.exe » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ CRLF
OLDNEW
(Empty)
1 @echo off
M-A Ruel 2012/04/13 19:00:58 Still keep a copyright header after the @echo off.
scottmg 2012/04/13 19:35:35 Done.
2 setlocal enabledelayedexpansion
3
4 :: Parse args to see if a -C argument (to change working directory) is being
5 :: supplied. We expect project generation to output a set_environment.bat that
6 :: will set up the environment (variables and path). This script generally
7 :: just calls the correct VS vars batch file, but only gyp has the knowledge
8 :: to determine which version of the IDE/toolchain it wants to use, so we have
9 :: to defer to it to make that decision.
10 set found_dash_c=0
11 set cd_path=.
12 for %%A in (%*) do (
13 if "!found_dash_c!"=="1" (
14 set cd_path=%%A
15 goto done_dash_c
16 )
17 if "%%A"=="-C" (
18 set found_dash_c=1
19 )
20 )
21 :done_dash_c
22
23 if not exist "%cd_path%\set_environment.bat" (
24 echo ninja.bat: set_environment.bat not found in '%cd_path%'. Is -C arg correc t?
25 goto script_exit
M-A Ruel 2012/04/13 19:00:58 goto :EOF would work fine.
scottmg 2012/04/13 19:35:35 Done.
26 )
27 call "%cd_path%\set_environment.bat"
28
29 :: Finally, add the ninja directory to the path so ninja and
30 :: ninja-deplist-helper are available.
31 set PATH=%~dp0ninja-win;%PATH%;
32
33 :: Add python to the path, many gyp rules assume it's there.
34 :: Add ninja directory to the path (to find ninja and ninja-deplist-helper).
35 :: Then, export only the path changes out of the script so that next time we
36 :: just run ninja directly (otherwise, this script adds about 500-800ms to
37 :: ninja invocations).
38 endlocal & set PATH=%~dp0python_bin;%~dp0ninja-win;%PATH%
39
40 :: Now run the actual build.
41 ninja.exe %*
42
43 :script_exit
OLDNEW
« 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