UNPKG

2.42 kBapplication/x-msdownloadView Raw
1@echo off
2
3REM -- Script requirements:
4REM --
5REM -- * git This program must be in the Path to check out
6REM -- build-gyp. If that directory already exists, then
7REM -- git isn't necessary, but if it is missing, no
8REM -- commit hash will be embedded into binaries.
9REM --
10REM -- * python A non-Cygwin Python 2 python.exe must be in the
11REM -- Path to run gyp.
12REM --
13REM -- * msbuild msbuild must be in the Path. It is probably
14REM -- important to have msbuild from the correct MSVC
15REM -- release.
16REM --
17REM -- The script's output binaries are in the src/Release/{Win32,x64}
18REM -- directory.
19
20REM -------------------------------------------------------------------------
21REM -- Parse arguments
22
23setlocal
24cd %~dp0
25set GYP_ARGS=
26set MSVC_PLATFORM=x64
27
28:ParamLoop
29if "%1" == "" goto :ParamDone
30if "%1" == "--msvc-platform" (
31 REM -- One of Win32 or x64.
32 set MSVC_PLATFORM=%2
33 shift && shift
34 goto :ParamLoop
35)
36if "%1" == "--gyp-msvs-version" (
37 set GYP_ARGS=%GYP_ARGS% -G msvs_version=%2
38 shift && shift
39 goto :ParamLoop
40)
41if "%1" == "--toolset" (
42 set GYP_ARGS=%GYP_ARGS% -D WINPTY_MSBUILD_TOOLSET=%2
43 shift && shift
44 goto :ParamLoop
45)
46if "%1" == "--commit-hash" (
47 set GYP_ARGS=%GYP_ARGS% -D WINPTY_COMMIT_HASH=%2
48 shift && shift
49 goto :ParamLoop
50)
51echo error: Unrecognized argument: %1
52exit /b 1
53:ParamDone
54
55REM -------------------------------------------------------------------------
56REM -- Check out GYP. GYP doesn't seem to have releases, so just use the
57REM -- current master commit.
58
59if not exist build-gyp (
60 git clone https://chromium.googlesource.com/external/gyp build-gyp || (
61 echo error: GYP clone failed
62 exit /b 1
63 )
64)
65
66REM -------------------------------------------------------------------------
67REM -- Run gyp to generate MSVC project files.
68
69cd src
70
71call ..\build-gyp\gyp.bat winpty.gyp -I configurations.gypi %GYP_ARGS%
72if errorlevel 1 (
73 echo error: GYP failed
74 exit /b 1
75)
76
77REM -------------------------------------------------------------------------
78REM -- Compile the project.
79
80msbuild winpty.sln /m /p:Platform=%MSVC_PLATFORM% || (
81 echo error: msbuild failed
82 exit /b 1
83)