Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |