OLD | NEW |
(Empty) | |
| 1 @echo off |
| 2 |
| 3 :: Copyright (c) 2012 Google Inc. All rights reserved. |
| 4 :: Use of this source code is governed by a BSD-style license that can be |
| 5 :: found in the LICENSE file. |
| 6 |
| 7 setlocal enabledelayedexpansion |
| 8 |
| 9 :: Parse args to see if a -C argument (to change working directory) is being |
| 10 :: supplied. We expect project generation to output a set_environment.bat that |
| 11 :: will set up the environment (variables and path). This script generally |
| 12 :: just calls the correct VS vars batch file, but only gyp has the knowledge |
| 13 :: to determine which version of the IDE/toolchain it wants to use, so we have |
| 14 :: to defer to it to make that decision. |
| 15 set found_dash_c=0 |
| 16 set cd_path=. |
| 17 for %%A in (%*) do ( |
| 18 if "!found_dash_c!"=="1" ( |
| 19 set cd_path=%%A |
| 20 goto done_dash_c |
| 21 ) |
| 22 if "%%A"=="-C" ( |
| 23 set found_dash_c=1 |
| 24 ) |
| 25 ) |
| 26 :done_dash_c |
| 27 |
| 28 if not exist "%cd_path%\set_environment.bat" ( |
| 29 echo ninja.bat: set_environment.bat not found in '%cd_path%'. Is -C arg correc
t? |
| 30 goto :EOF |
| 31 ) |
| 32 call "%cd_path%\set_environment.bat" |
| 33 |
| 34 :: Add python to the path, many gyp rules assume it's there. |
| 35 :: Add ninja directory to the path (to find ninja and ninja-deplist-helper). |
| 36 :: Then, export only the path changes out of the script so that next time we |
| 37 :: just run ninja directly (otherwise, this script adds about 500-800ms to |
| 38 :: ninja invocations). |
| 39 endlocal & set PATH=%~dp0python_bin;%~dp0ninja-win;%PATH% & set INCLUDE=%INCLUDE
% & set LIBPATH=%LIBPATH% & set LIB=%LIB% |
| 40 |
| 41 :: Now run the actual build. |
| 42 ninja.exe %* |
OLD | NEW |