2016-08-10 19:36:00 +00:00
|
|
|
@echo OFF
|
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
set "FullScriptPath=%~dp0"
|
|
|
|
set "FullExecPath=%cd%"
|
|
|
|
|
2016-08-13 17:43:21 +00:00
|
|
|
set "Silence=>nul"
|
|
|
|
if "%1" == "-v" set "Silence="
|
|
|
|
|
2016-08-14 18:05:10 +00:00
|
|
|
rem strangely linking of Release Telegram build complains about the absence of lib.pdb
|
|
|
|
if exist "%FullScriptPath%..\..\..\Libraries\openssl\tmp32\lib.pdb" (
|
|
|
|
if not exist "%FullScriptPath%..\..\..\Libraries\openssl\Release\lib\lib.pdb" (
|
|
|
|
xcopy "%FullScriptPath%..\..\..\Libraries\openssl\tmp32\lib.pdb" "%FullScriptPath%..\..\..\Libraries\openssl\Release\lib\" %Silence%
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2016-08-10 19:36:00 +00:00
|
|
|
cd "%FullScriptPath%"
|
2016-08-13 17:43:21 +00:00
|
|
|
call gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=ninja
|
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
call gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=msvs-ninja
|
|
|
|
if %errorlevel% neq 0 goto error
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
rem looks like ninja build works without sdk 7.1 which was used by generating custom environment.arch files
|
|
|
|
|
|
|
|
rem cd "%FullScriptPath%"
|
|
|
|
rem call gyp --depth=. --generator-output=../.. -Goutput_dir=out -Gninja_use_custom_environment_files=1 Telegram.gyp --format=ninja
|
|
|
|
rem if %errorlevel% neq 0 goto error
|
|
|
|
rem call gyp --depth=. --generator-output=../.. -Goutput_dir=out -Gninja_use_custom_environment_files=1 Telegram.gyp --format=msvs-ninja
|
|
|
|
rem if %errorlevel% neq 0 goto error
|
|
|
|
rem cd ../..
|
|
|
|
|
|
|
|
rem call msbuild /target:SetBuildDefaultEnvironmentVariables Telegram.vcxproj /fileLogger %Silence%
|
|
|
|
rem if %errorlevel% neq 0 goto error
|
2016-08-10 19:36:00 +00:00
|
|
|
|
2016-08-13 17:43:21 +00:00
|
|
|
rem call python "%FullScriptPath%create_env.py"
|
|
|
|
rem if %errorlevel% neq 0 goto error
|
|
|
|
|
|
|
|
rem call move environment.x86 out\Debug\ %Silence%
|
|
|
|
rem if %errorlevel% neq 0 goto error
|
|
|
|
|
|
|
|
cd "%FullExecPath%"
|
2016-08-10 19:36:00 +00:00
|
|
|
exit /b
|
2016-08-13 17:43:21 +00:00
|
|
|
|
|
|
|
:error
|
|
|
|
echo FAILED
|
|
|
|
if exist "%FullScriptPath%..\..\msbuild.log" del "%FullScriptPath%..\..\msbuild.log"
|
|
|
|
if exist "%FullScriptPath%..\..\environment.x86" del "%FullScriptPath%..\..\environment.x86"
|
|
|
|
cd "%FullExecPath%"
|
|
|
|
exit /b 1
|