Chromium Code Reviews| Index: ninja.bat |
| =================================================================== |
| --- ninja.bat (revision 0) |
| +++ ninja.bat (revision 0) |
| @@ -0,0 +1,43 @@ |
| +@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.
|
| +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 script_exit |
|
M-A Ruel
2012/04/13 19:00:58
goto :EOF
would work fine.
scottmg
2012/04/13 19:35:35
Done.
|
| +) |
| +call "%cd_path%\set_environment.bat" |
| + |
| +:: Finally, add the ninja directory to the path so ninja and |
| +:: ninja-deplist-helper are available. |
| +set PATH=%~dp0ninja-win;%PATH%; |
| + |
| +:: 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% |
| + |
| +:: Now run the actual build. |
| +ninja.exe %* |
| + |
| +:script_exit |
| Property changes on: ninja.bat |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + CRLF |