3 REM -- Script requirements:
5 REM -- * git This program must be in the Path to check out
6 REM -- build-gyp. If that directory already exists, then
7 REM -- git isn't necessary, but if it is missing, no
8 REM -- commit hash will be embedded into binaries.
10 REM -- * python A non-Cygwin Python 2 python.exe must be in the
11 REM -- Path to run gyp.
13 REM -- * msbuild msbuild must be in the Path. It is probably
14 REM -- important to have msbuild from the correct MSVC
17 REM -- The script's output binaries are in the src/Release/{Win32,x64}
20 REM -------------------------------------------------------------------------
21 REM -- Parse arguments
29 if "%1" == "" goto :ParamDone
30 if "%1" == "--msvc-platform" (
31 REM -- One of Win32 or x64.
36 if "%1" == "--gyp-msvs-version" (
37 set GYP_ARGS=%GYP_ARGS% -G msvs_version=%2
41 if "%1" == "--toolset" (
42 set GYP_ARGS=%GYP_ARGS% -D WINPTY_MSBUILD_TOOLSET=%2
46 if "%1" == "--commit-hash" (
47 set GYP_ARGS=%GYP_ARGS% -D WINPTY_COMMIT_HASH=%2
51 echo error: Unrecognized argument: %1
55 REM -------------------------------------------------------------------------
56 REM -- Check out GYP. GYP doesn't seem to have releases, so just use the
57 REM -- current master commit.
59 if not exist build-gyp (
60 git clone https://chromium.googlesource.com/external/gyp build-gyp || (
61 echo error: GYP clone failed
66 REM -------------------------------------------------------------------------
67 REM -- Run gyp to generate MSVC project files.
71 call ..\build-gyp\gyp.bat winpty.gyp -I configurations.gypi %GYP_ARGS%
73 echo error: GYP failed
77 REM -------------------------------------------------------------------------
78 REM -- Compile the project.
80 msbuild winpty.sln /m /p:Platform=%MSVC_PLATFORM% || (
81 echo error: msbuild failed