From fd1a8014c4cf3981febf848d0c5f9128d70cc6e0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 6 Dec 2019 15:14:24 +0300 Subject: [PATCH] Add Packer project to cmake configuration. --- Telegram/CMakeLists.txt | 23 +++++++++++++++++++++++ Telegram/build/build.bat | 23 ++++++++--------------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index d0a99a7c0..1c967e8db 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -1124,4 +1124,27 @@ if (NOT build_macstore AND NOT build_winstore) ) set_target_properties(Updater PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder}) + + if (DESKTOP_APP_SPECIAL_TARGET) + add_executable(Packer WIN32) + init_target(Packer) + + add_dependencies(Telegram Packer) + + nice_target_sources(Packer ${src_loc} + PRIVATE + _other/packer.cpp + _other/packer.h + ) + + target_link_libraries(Packer + PRIVATE + desktop-app::external_qt + desktop-app::external_zlib + desktop-app::external_auto_updates + desktop-app::external_openssl + ) + + set_target_properties(Packer PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder}) + endif() endif() diff --git a/Telegram/build/build.bat b/Telegram/build/build.bat index 52695311a..5f8c956f7 100644 --- a/Telegram/build/build.bat +++ b/Telegram/build/build.bat @@ -122,9 +122,7 @@ if not exist "%SolutionPath%\..\..\Libraries\breakpad\src\tools\windows\dump_sym ) echo Dumping debug symbols.. -xcopy "%ReleasePath%\%BinaryName%.exe" "%ReleasePath%\%BinaryName%.exe.exe*" -call "%SolutionPath%\..\..\Libraries\breakpad\src\tools\windows\dump_syms\Release\dump_syms.exe" "%ReleasePath%\%BinaryName%.exe.pdb" > "%ReleasePath%\%BinaryName%.exe.sym" -del "%ReleasePath%\%BinaryName%.exe.exe" +call "%SolutionPath%\..\..\Libraries\breakpad\src\tools\windows\dump_syms\Release\dump_syms.exe" "%ReleasePath%\%BinaryName%.pdb" > "%ReleasePath%\%BinaryName%.sym" echo Done! set "PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files (x86)\Inno Setup 5" @@ -186,10 +184,10 @@ for /f ^"usebackq^ eol^=^ :symbolslinedone FOR /F "tokens=1,2,3,4* delims= " %%i in ("%SymbolsHashLine%") do set "SymbolsHash=%%l" -echo Copying %BinaryName%.exe.sym to %DropboxSymbolsPath%\%BinaryName%.exe.pdb\%SymbolsHash% -if not exist %DropboxSymbolsPath%\%BinaryName%.exe.pdb mkdir %DropboxSymbolsPath%\%BinaryName%.exe.pdb -if not exist %DropboxSymbolsPath%\%BinaryName%.exe.pdb\%SymbolsHash% mkdir %DropboxSymbolsPath%\%BinaryName%.exe.pdb\%SymbolsHash% -move "%ReleasePath%\%BinaryName%.exe.sym" %DropboxSymbolsPath%\%BinaryName%.exe.pdb\%SymbolsHash%\ +echo Copying %BinaryName%.sym to %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash% +if not exist %DropboxSymbolsPath%\%BinaryName%.pdb mkdir %DropboxSymbolsPath%\%BinaryName%.pdb +if not exist %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash% mkdir %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash% +move "%ReleasePath%\%BinaryName%.sym" %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash%\ echo Done! if %BuildUWP% neq 0 ( @@ -225,8 +223,7 @@ if %BuildUWP% neq 0 ( if not exist "%ReleasePath%\deploy\%AppVersionStrMajor%" mkdir "%ReleasePath%\deploy\%AppVersionStrMajor%" mkdir "%DeployPath%" - xcopy "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\" - move "%ReleasePath%\%BinaryName%.exe.pdb" "%DeployPath%\" + move "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\" move "%ReleasePath%\%BinaryName%.x86.appx" "%DeployPath%\" move "%ReleasePath%\%BinaryName%.x64.appx" "%DeployPath%\" move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\" @@ -246,10 +243,8 @@ if %BuildUWP% neq 0 ( move "%ReleasePath%\%BinaryName%.exe" "%DeployPath%\%BinaryName%\" move "%ReleasePath%\Updater.exe" "%DeployPath%\" - xcopy "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\" - xcopy "%ReleasePath%\Updater.pdb" "%DeployPath%\" - move "%ReleasePath%\%BinaryName%.exe.pdb" "%DeployPath%\" - move "%ReleasePath%\Updater.exe.pdb" "%DeployPath%\" + move "%ReleasePath%\%BinaryName%.pdb" "%DeployPath%\" + move "%ReleasePath%\Updater.pdb" "%DeployPath%\" if %AlphaVersion% equ 0 ( move "%ReleasePath%\%SetupFile%" "%DeployPath%\" ) else ( @@ -280,10 +275,8 @@ if %BuildUWP% equ 0 ( if not exist "%DeployPath%\%SetupFile%" goto error ) if not exist "%DeployPath%\%BinaryName%.pdb" goto error - if not exist "%DeployPath%\%BinaryName%.exe.pdb" goto error if not exist "%DeployPath%\Updater.exe" goto error if not exist "%DeployPath%\Updater.pdb" goto error - if not exist "%DeployPath%\Updater.exe.pdb" goto error md "%FinalDeployPath%" xcopy "%DeployPath%\%UpdateFile%" "%FinalDeployPath%\" /Y