2016-08-10 19:36:00 +00:00
|
|
|
@echo OFF
|
2017-02-19 11:34:10 +00:00
|
|
|
setlocal EnableDelayedExpansion
|
2016-08-10 19:36:00 +00:00
|
|
|
set "FullScriptPath=%~dp0"
|
|
|
|
set "FullExecPath=%cd%"
|
|
|
|
|
2016-08-13 17:43:21 +00:00
|
|
|
set "Silence=>nul"
|
|
|
|
if "%1" == "-v" set "Silence="
|
|
|
|
|
2017-04-19 09:44:07 +00:00
|
|
|
if exist "%FullScriptPath%..\build\target" (
|
|
|
|
FOR /F "tokens=1* delims= " %%i in (%FullScriptPath%..\build\target) do set "BuildTarget=%%i"
|
|
|
|
) else (
|
|
|
|
set "BuildTarget="
|
|
|
|
)
|
|
|
|
|
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%
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2017-02-19 11:34:10 +00:00
|
|
|
set BUILD_DEFINES=
|
|
|
|
if not "%TDESKTOP_BUILD_DEFINES%" == "" (
|
|
|
|
set "BUILD_DEFINES=-Dbuild_defines=%TDESKTOP_BUILD_DEFINES%"
|
|
|
|
echo [INFO] Set build defines to !BUILD_DEFINES!
|
2017-02-18 19:23:50 +00:00
|
|
|
)
|
|
|
|
|
2017-09-05 17:46:16 +00:00
|
|
|
set GYP_MSVS_VERSION=2017
|
2017-05-05 09:25:06 +00:00
|
|
|
|
2016-08-10 19:36:00 +00:00
|
|
|
cd "%FullScriptPath%"
|
2017-05-18 09:04:39 +00:00
|
|
|
call gyp --depth=. --generator-output=.. -Goutput_dir=../out !BUILD_DEFINES! -Dofficial_build_target=%BuildTarget% Telegram.gyp --format=ninja
|
2016-08-13 17:43:21 +00:00
|
|
|
if %errorlevel% neq 0 goto error
|
2017-05-18 09:04:39 +00:00
|
|
|
call gyp --depth=. --generator-output=.. -Goutput_dir=../out !BUILD_DEFINES! -Dofficial_build_target=%BuildTarget% Telegram.gyp --format=msvs-ninja
|
2016-08-13 17:43:21 +00:00
|
|
|
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
|