forked from tjanczuk/httpsys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
76 lines (66 loc) · 1.83 KB
/
Copy pathbuild.bat
File metadata and controls
76 lines (66 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@echo off
set SELF=%~dp0
if "%1" equ "" (
echo Usage: build.bat debug^|release "{version} {version}" ...
echo e.g. build.bat release "0.8.22 0.10.0"
exit /b -1
)
SET FLAVOR=%1
shift
if "%FLAVOR%" equ "" set FLAVOR=release
for %%i in (node.exe) do set NODEEXE=%%~$PATH:i
if not exist "%NODEEXE%" (
echo Cannot find node.exe
popd
exit /b -1
)
for %%i in ("%NODEEXE%") do set NODEDIR=%%~dpi
SET DESTDIRROOT=%SELF%\..\lib\native\win32
set VERSIONS=
:harvestVersions
if "%1" neq "" (
set VERSIONS=%VERSIONS% %1
shift
goto :harvestVersions
)
if "%VERSIONS%" equ "" set VERSIONS=0.10.0
pushd %SELF%\..
for %%V in (%VERSIONS%) do call :build ia32 x86 %%V
for %%V in (%VERSIONS%) do call :build x64 x64 %%V
popd
exit /b 0
:build
set DESTDIR=%DESTDIRROOT%\%1\%3
if exist "%DESTDIR%\node.exe" goto gyp
if not exist "%DESTDIR%\NUL" mkdir "%DESTDIR%"
echo Downloading node.exe %2 %3...
node %SELF%\download.js %2 %3 "%DESTDIR%"
if %ERRORLEVEL% neq 0 (
echo Cannot download node.exe %2 v%3
exit /b -1
)
:gyp
echo Building httpsys.node %FLAVOR% for node.js %2 v%3
set NODEEXE=%DESTDIR%\node.exe
set GYP=%APPDATA%\npm\node_modules\node-gyp\bin\node-gyp.js
if not exist "%GYP%" (
echo Cannot find node-gyp at %GYP%. Make sure to install with npm install node-gyp -g
exit /b -1
)
"%NODEEXE%" "%GYP%" configure build --msvs_version=2012 -%FLAVOR%
if %ERRORLEVEL% neq 0 (
echo Error building httpsys.node %FLAVOR% for node.js %2 v%3
exit /b -1
)
echo %DESTDIR%
copy /y .\build\%FLAVOR%\httpsys.node "%DESTDIR%"
if %ERRORLEVEL% neq 0 (
echo Error copying httpsys.node %FLAVOR% for node.js %2 v%3
exit /b -1
)
copy /y "%DESTDIR%\..\msvcr110.dll" "%DESTDIR%"
if %ERRORLEVEL% neq 0 (
echo Error copying msvcr110.dll %FLAVOR% to %DESTDIR%
exit /b -1
)
echo Success building httpsys.node %FLAVOR% for node.js %2 v%3