2014-01-14 10:04:03 +00:00
|
|
|
@ECHO OFF
|
|
|
|
|
2014-01-23 12:39:34 +00:00
|
|
|
REM First argument is the target architecture
|
|
|
|
REM Second argument is "Debug" or "Release" mode
|
|
|
|
REM Third argument is the V8 root directory path
|
|
|
|
REM Fourth argument is the version of Visual Studio (optional)
|
|
|
|
|
2014-01-14 10:04:03 +00:00
|
|
|
IF "%1" == "" GOTO Fail
|
|
|
|
IF "%2" == "" GOTO Fail
|
|
|
|
IF "%3" == "" GOTO Fail
|
|
|
|
|
2014-01-23 12:39:34 +00:00
|
|
|
REM Go into the V8 lib directory
|
2014-01-14 10:04:03 +00:00
|
|
|
cd "%3"
|
|
|
|
|
2014-01-23 12:39:34 +00:00
|
|
|
REM Check the last build info, so we know if we're supposed to build again or not
|
2014-01-14 10:04:03 +00:00
|
|
|
SET /P LAST_BUILD_INFO=<last_build
|
|
|
|
IF "%1-%2" == "%LAST_BUILD_INFO%" (
|
2014-01-23 12:39:34 +00:00
|
|
|
IF EXIST ".\build\%2\v8.dll" (
|
|
|
|
ECHO V8 is already built!
|
|
|
|
SET COPY_FILES_ONLY=1
|
|
|
|
)
|
2014-01-14 10:04:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
SET LIB_DEST_DIR=
|
|
|
|
|
2014-01-23 12:39:34 +00:00
|
|
|
IF NOT "%4" == "" (
|
|
|
|
SET VS_VERSION=-Gmsvs_version=%4
|
|
|
|
ECHO Forcing build to use Visual Studio %4
|
|
|
|
)
|
|
|
|
|
2014-01-14 10:04:03 +00:00
|
|
|
IF "%1" == "x64" (
|
2014-01-23 12:39:34 +00:00
|
|
|
REM If this is a 32-bit system (but we target x64), we must disable the snapshot feature to get it to build.
|
|
|
|
IF NOT EXIST "%PROGRAMFILES(X86)%" (
|
|
|
|
SET SKIP_V8_SNAPSHOT=-Dv8_use_snapshot=false
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
IF "%1" == "x64" (
|
|
|
|
IF NOT "%SKIP_V8_SNAPSHOT%" == "" ECHO Targeting x64 platform on a x86 system, disabling V8 snapshout feature to make this work [%SKIP_V8_SNAPSHOT%]
|
|
|
|
IF NOT "%COPY_FILES_ONLY%" == "1" .\third_party\python_26\python.exe build\gyp_v8 -Dtarget_arch=x64 -Dcomponent=shared_library %SKIP_V8_SNAPSHOT% %VS_VERSION%
|
2014-01-14 10:04:03 +00:00
|
|
|
IF NOT ERRORLEVEL 0 GOTO Fail
|
|
|
|
SET LIB_DEST_DIR=..\..\x64\%2\
|
|
|
|
)
|
|
|
|
|
|
|
|
IF "%1" == "x86" (
|
2014-01-23 12:39:34 +00:00
|
|
|
IF NOT "%COPY_FILES_ONLY%" == "1" .\third_party\python_26\python.exe build\gyp_v8 -Dcomponent=shared_library %VS_VERSION%
|
2014-01-14 10:04:03 +00:00
|
|
|
IF NOT ERRORLEVEL 0 GOTO Fail
|
|
|
|
SET LIB_DEST_DIR=..\..\Win32\%2\
|
|
|
|
)
|
|
|
|
|
|
|
|
IF "%LIB_DEST_DIR%" == "" GOTO Fail
|
|
|
|
|
|
|
|
IF "%COPY_FILES_ONLY%" == "1" GOTO CopyFiles
|
|
|
|
|
2014-01-23 12:39:34 +00:00
|
|
|
REM Clean build before we continue
|
|
|
|
devenv /clean %2 tools\gyp\v8.sln
|
2014-01-14 10:04:03 +00:00
|
|
|
IF NOT ERRORLEVEL 0 GOTO Fail
|
|
|
|
|
2014-01-23 12:39:34 +00:00
|
|
|
REM Just to make sure that everything is cleaned up
|
|
|
|
rmdir /S /Q .\build\%2
|
|
|
|
|
|
|
|
REM Build the V8 library
|
2014-01-24 03:51:11 +00:00
|
|
|
devenv /build %2 "tools\gyp\v8.sln" /project "v8" /projectconfig %2
|
2014-01-23 12:39:34 +00:00
|
|
|
REM devenv /build %2 tools\gyp\v8.sln
|
2014-01-14 10:04:03 +00:00
|
|
|
IF NOT ERRORLEVEL 0 GOTO Fail
|
|
|
|
|
|
|
|
:CopyFiles
|
|
|
|
|
|
|
|
REM xcopy /C /F /R /Y .\build\%2\icudt.dll %LIB_DEST_DIR%
|
|
|
|
REM IF NOT ERRORLEVEL 0 GOTO Fail
|
|
|
|
|
|
|
|
xcopy /C /F /R /Y .\build\%2\icui18n.dll %LIB_DEST_DIR%
|
|
|
|
IF NOT ERRORLEVEL 0 GOTO Fail
|
|
|
|
|
|
|
|
xcopy /C /F /R /Y .\build\%2\icuuc.dll %LIB_DEST_DIR%
|
|
|
|
IF NOT ERRORLEVEL 0 GOTO Fail
|
|
|
|
|
|
|
|
xcopy /C /F /R /Y .\build\%2\v8.dll %LIB_DEST_DIR%
|
|
|
|
IF NOT ERRORLEVEL 0 GOTO Fail
|
|
|
|
|
|
|
|
ECHO %1-%2> last_build
|
|
|
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
:Fail
|
2014-01-23 12:39:34 +00:00
|
|
|
REM Delete the last_build info if this build failed!
|
|
|
|
@del /Q last_build
|
2014-01-14 10:04:03 +00:00
|
|
|
exit /b 1
|