Update build docs for VS 2017.

Closes #3117. Closes #3729.
This commit is contained in:
John Preston 2017-09-06 12:12:27 +03:00
parent 7ae1ef0a1a
commit b8d1b8d6c1
8 changed files with 171 additions and 33499 deletions

View File

@ -41,7 +41,7 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
## Build instructions
* [Visual Studio 2015][msvc]
* [Visual Studio 2017][msvc]
* [Xcode 8][xcode]
* [GYP/CMake on GNU/Linux][cmake]

View File

@ -1,5 +1,17 @@
diff --git a/src/build/common.gypi b/src/build/common.gypi
index b9466a3..9fb31aa 100644
--- a/src/build/common.gypi
+++ b/src/build/common.gypi
@@ -330,6 +330,7 @@
'VCCLCompilerTool': {
'WarnAsError': 'true',
'Detect64BitPortabilityProblems': 'false',
+ 'TreatWChar_tAsBuiltInType': 'false',
},
},
}],
diff --git a/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/src/client/mac/Breakpad.xcodeproj/project.pbxproj
index 584ec5d..1c7214f 100644
index 1a93ce6..1c1d643 100644
--- a/src/client/mac/Breakpad.xcodeproj/project.pbxproj
+++ b/src/client/mac/Breakpad.xcodeproj/project.pbxproj
@@ -35,6 +35,19 @@
@ -77,7 +89,7 @@ index 584ec5d..1c7214f 100644
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -715,7 +703,6 @@
@@ -714,7 +702,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
@ -85,7 +97,7 @@ index 584ec5d..1c7214f 100644
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1183,18 +1170,13 @@
@@ -1181,18 +1168,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */;
buildPhases = (
@ -104,7 +116,7 @@ index 584ec5d..1c7214f 100644
);
name = Breakpad;
productInstallPath = "$(HOME)/Library/Frameworks";
@@ -1401,6 +1383,8 @@
@@ -1399,6 +1381,8 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
@ -113,7 +125,7 @@ index 584ec5d..1c7214f 100644
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
@@ -1585,16 +1569,6 @@
@@ -1583,16 +1567,6 @@
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
@ -130,7 +142,7 @@ index 584ec5d..1c7214f 100644
F92C569C0ECE04A7009BE4BA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1642,20 +1616,6 @@
@@ -1640,20 +1614,6 @@
shellPath = /bin/sh;
shellScript = "install_name_tool -id \"@executable_path/../Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n";
};
@ -151,7 +163,7 @@ index 584ec5d..1c7214f 100644
F9C77DD80F7DD5CF0045F7DB /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -1676,6 +1636,19 @@
@@ -1674,6 +1634,19 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
@ -171,7 +183,7 @@ index 584ec5d..1c7214f 100644
F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */,
F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */,
F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */,
@@ -1957,16 +1930,6 @@
@@ -1955,16 +1928,6 @@
target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */;
targetProxy = F92C564D0ECD10E5009BE4BA /* PBXContainerItemProxy */;
};
@ -188,7 +200,7 @@ index 584ec5d..1c7214f 100644
F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = F93803BD0F80820F004D428B /* generator_test */;
@@ -2027,11 +1990,6 @@
@@ -2025,11 +1988,6 @@
target = 8DC2EF4F0486A6940098B216 /* Breakpad */;
targetProxy = F9C44E190EF0790F003AEBAA /* PBXContainerItemProxy */;
};
@ -200,7 +212,7 @@ index 584ec5d..1c7214f 100644
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -2128,8 +2086,12 @@
@@ -2126,8 +2084,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
buildSettings = {
@ -214,7 +226,7 @@ index 584ec5d..1c7214f 100644
};
name = Debug;
};
@@ -2137,7 +2099,12 @@
@@ -2135,7 +2097,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */;
buildSettings = {
@ -227,7 +239,7 @@ index 584ec5d..1c7214f 100644
};
name = Release;
};
@@ -2456,7 +2423,12 @@
@@ -2454,7 +2421,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
buildSettings = {

View File

@ -0,0 +1,18 @@
set -e
FullExecPath=$PWD
pushd `dirname $0` > /dev/null
FullScriptPath=`pwd`
popd > /dev/null
pacman --noconfirm -Sy
pacman --noconfirm -S msys/make
pacman --noconfirm -S mingw64/mingw-w64-x86_64-opus
pacman --noconfirm -S diffutils
pacman --noconfirm -S pkg-config
PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
./configure --toolchain=msvc --disable-programs --disable-doc --disable-everything --enable-protocol=file --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=flac --enable-decoder=gif --enable-decoder=h264 --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=mpeg4 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=pcm_alaw --enable-decoder=pcm_alaw_at --enable-decoder=pcm_f32be --enable-decoder=pcm_f32le --enable-decoder=pcm_f64be --enable-decoder=pcm_f64le --enable-decoder=pcm_lxf --enable-decoder=pcm_mulaw --enable-decoder=pcm_mulaw_at --enable-decoder=pcm_s16be --enable-decoder=pcm_s16be_planar --enable-decoder=pcm_s16le --enable-decoder=pcm_s16le_planar --enable-decoder=pcm_s24be --enable-decoder=pcm_s24daud --enable-decoder=pcm_s24le --enable-decoder=pcm_s24le_planar --enable-decoder=pcm_s32be --enable-decoder=pcm_s32le --enable-decoder=pcm_s32le_planar --enable-decoder=pcm_s64be --enable-decoder=pcm_s64le --enable-decoder=pcm_s8 --enable-decoder=pcm_s8_planar --enable-decoder=pcm_u16be --enable-decoder=pcm_u16le --enable-decoder=pcm_u24be --enable-decoder=pcm_u24le --enable-decoder=pcm_u32be --enable-decoder=pcm_u32le --enable-decoder=pcm_u8 --enable-decoder=pcm_zork --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-hwaccel=h264_d3d11va --enable-hwaccel=h264_dxva2 --enable-parser=aac --enable-parser=aac_latm --enable-parser=flac --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=flac --enable-demuxer=gif --enable-demuxer=h264 --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=wav --enable-muxer=ogg --enable-muxer=opus --extra-ldflags="-libpath:$FullExecPath/../opus/win32/VS2015/Win32/Release"
make -j4
make -j4 install

File diff suppressed because it is too large Load Diff

View File

@ -30,16 +30,12 @@ Install dev libraries
sudo apt-get install libexif-dev liblzma-dev libz-dev libssl-dev libappindicator-dev libunity-dev libicu-dev libdee-dev
#### zlib 1.2.8
#### zlib
http://www.zlib.net/ > Download [**zlib source code, version 1.2.8, tarball format**](http://zlib.net/fossils/zlib-1.2.8.tar.gz)
Extract to **/home/user/TBuild/Libraries**
##### Building library
In Terminal go to **/home/user/TBuild/Libraries/zlib-1.2.8** and run:
In Terminal go to **/home/user/TBuild/Libraries** and run
git clone https://github.com/telegramdesktop/zlib.git
cd zlib
./configure
make
sudo make install
@ -147,6 +143,13 @@ In Terminal go to **/home/user/TBuild/Libraries** and run
cd qtbase && git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff && cd ..
##### Add additional input method plugins
cd qtbase/src/plugins/platforminputcontexts
git clone https://github.com/telegramdesktop/fcitx.git
git clone https://github.com/telegramdesktop/hime.git
cd ../../../..
##### Building library
Install some packages for Qt (see **/home/user/TBuild/Libraries/qt5_6_2/qtbase/src/plugins/platforms/xcb/README**)

View File

@ -1,306 +1,165 @@
# Build instructions for Visual Studio 2015
# Build instructions for Visual Studio 2017
- [Prepare folder](#prepare-folder)
- [Clone source code](#clone-source-code)
- [Prepare libraries](#prepare-libraries)
* [OpenSSL](#openssl)
* [LZMA SDK 9.20](#lzma-sdk-920)
+ [Building library](#building-library)
* [zlib 1.2.8](#zlib-128)
+ [Building library](#building-library-1)
* [libexif 0.6.20](#libexif-0620)
+ [Building library](#building-library-2)
* [OpenAL Soft, slightly patched](#openal-soft-slightly-patched)
+ [Building library](#building-library-3)
* [Opus codec](#opus-codec)
+ [Building libraries](#building-libraries)
* [FFmpeg](#ffmpeg)
+ [Building libraries](#building-libraries-1)
* [Qt 5.6.2, slightly patched](#qt-562-slightly-patched)
+ [Apply the patch](#apply-the-patch)
+ [Install Windows SDKs](#install-windows-sdks)
+ [Building library](#building-library-4)
* [Qt5Package](#qt5package)
* [Google Breakpad](#google-breakpad)
+ [Installation](#installation)
- [depot_tools](#depot_tools)
- [Breakpad](#breakpad)
+ [Build](#build)
- [Building Telegram Desktop](#building-telegram-desktop)
+ [Setup GYP/Ninja and generate VS solution](#setup-gypninja-and-generate-vs-solution)
+ [Configure VS](#configure-vs)
+ [Build the project](#build-the-project)
- [Install third party software](#install-third-party-software)
- [Clone source code and prepare libraries](#clone-source-code-and-prepare-libraries)
- [Build the project](#build-the-project)
- [Qt Visual Studio Tools](#qt-visual-studio-tools)
## Prepare folder
Choose a folder for the future build, for example **D:\\TBuild\\**. There you will have two folders, **Libraries** for third-party libs and **tdesktop** for the app.
Choose an empty folder for the future build, for example **D:\\TBuild**. It will be named ***BuildPath*** in the rest of this document. Create two folders there, ***BuildPath*\\ThirdParty** and ***BuildPath*\\Libraries**
All commands (if not stated otherwise) will be launched from **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder). Pay attention not to use another VS2015 Command Prompt.
All commands (if not stated otherwise) will be launched from **x86 Native Tools Command Prompt for VS 2017.bat** (should be in **Start Menu > Visual Studio 2017** menu folder). Pay attention not to use any other Command Prompt.
#### A note on D:\\TBuild
## Install third party software
***In case you don't have a *D* drive, or prefer to use another working directory.***
Since all of the examples and commands here are using the *D* drive, you might find it more comfortable to map the drive to a folder you of your choice.
For example, to map *D:\\* to *C:\\base_folder_for_telegram_dev*, open the cmd and execute: `subst D: C:\base_folder_for_telegram_dev`.
* Download **ActivePerl** installer from [https://www.activestate.com/activeperl/downloads](https://www.activestate.com/activeperl/downloads) and install to ***BuildPath*\\ThirdParty\\Perl**
* Download **NASM** installer from [http://www.nasm.us](http://www.nasm.us) and install to ***BuildPath*\\ThirdParty\\NASM**
* Download **Yasm** executable from [http://yasm.tortall.net/Download.html](http://yasm.tortall.net/Download.html), rename to *yasm.exe* and put to ***BuildPath*\\ThirdParty\\yasm**
* Download **MSYS2** installer from [http://www.msys2.org/](http://www.msys2.org/) and install to ***BuildPath*\\ThirdParty\\msys64**
* Download **jom** archive from [http://download.qt.io/official_releases/jom/jom.zip](http://download.qt.io/official_releases/jom/jom.zip) and unpack to ***BuildPath*\\ThirdParty\\jom**
* Download **Python 2.7* installer from [https://www.python.org/downloads/](https://www.python.org/downloads/) and install to ***BuildPath*\\ThirdParty\\Python27**
* Download **CMake** installer from [https://cmake.org/download/](https://cmake.org/download/) and install to ***BuildPath*\\ThirdParty\\cmake**
* Download **Ninja** executable from [https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip](https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip) and unpack to ***BuildPath*\\ThirdParty\\Ninja**
## Clone source code
Open **x86 Native Tools Command Prompt for VS 2017.bat**, go to ***BuildPath*** and run
Go to **D:\\TBuild**
cd ThirdParty
git clone https://chromium.googlesource.com/external/gyp
cd gyp
git checkout a478c1ab51
cd ..\..
D:
cd TBuild
Add **GYP** and **Ninja** to your PATH:
and run
* Open **Control Panel** -> **System** -> **Advanced system settings**
* Press **Environment Variables...**
* Select **Path**
* Press **Edit**
* Add ***BuildPath*\\ThirdParty\\gyp** value
* Add ***BuildPath*\\ThirdParty\\Ninja** value
## Clone source code and prepare libraries
Open **x86 Native Tools Command Prompt for VS 2017.bat**, go to ***BuildPath*** and run
SET PATH=%cd%\ThirdParty\Perl\bin;%cd%\ThirdParty\Python27;%cd%\ThirdParty\NASM;%cd%\ThirdParty\jom;%cd%\ThirdParty\yasm;%PATH%
git clone --recursive https://github.com/telegramdesktop/tdesktop.git
mkdir Libraries
cd Libraries
## Prepare libraries
### OpenSSL
Go to **D:\\TBuild\\Libraries** and run
git clone https://github.com/telegramdesktop/lzma.git
cd lzma\C\Util\LzmaLib
msbuild LzmaLib.sln /property:Configuration=Debug
msbuild LzmaLib.sln /property:Configuration=Release
cd ..\..\..\..
git clone https://github.com/openssl/openssl.git
cd openssl
git checkout OpenSSL_1_0_1-stable
perl Configure VC-WIN32 --prefix=D:\TBuild\Libraries\openssl\Release
perl Configure no-shared --prefix=%cd%\Release --openssldir=%cd%\Release VC-WIN32
ms\do_ms
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
xcopy tmp32\lib.pdb Release\lib\
nmake -f ms\nt.mak clean
perl Configure no-shared --prefix=%cd%\Debug --openssldir=%cd%\Debug debug-VC-WIN32
ms\do_ms
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
xcopy tmp32.dbg\lib.pdb Debug\lib\
cd ..
git clone https://github.com/openssl/openssl.git openssl_debug
cd openssl_debug
git checkout OpenSSL_1_0_1-stable
perl Configure debug-VC-WIN32 --prefix=D:\TBuild\Libraries\openssl_debug\Debug
ms\do_ms
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
### LZMA SDK 9.20
http://www.7-zip.org/sdk.html > Download [**LZMA SDK (C, C++, C#, Java)** 9.20](http://downloads.sourceforge.net/sevenzip/lzma920.tar.bz2)
Extract to **D:\\TBuild\\Libraries**
#### Building library
* Open in VS2015 **D:\\TBuild\\Libraries\\lzma\\C\\Util\\LzmaLib\\LzmaLib.dsw** > One-way upgrade **OK**
* For **Debug** and **Release** configurations
* LzmaLib Properties > General > Configuration Type = **Static library (.lib)** **Apply**
* LzmaLib Properties > Librarian > General > Target Machine = **MachineX86 (/MACHINE:X86)** **OK**
* If you can't find **Librarian**, you forgot to click **Apply** after changing the Configuration Type.
* For **Debug** configuration
* LzmaLib Properties > C/C++ > General > Debug Information Format = **Program Database (/Zi)** - **OK**
* Build Debug configuration
* Build Release configuration
### zlib 1.2.8
http://www.zlib.net/fossils/ > Download [zlib-1.2.8.tar.gz](http://www.zlib.net/fossils/zlib-1.2.8.tar.gz)
Extract to **D:\\TBuild\\Libraries**
#### Building library
* Open in VS2015 **D:\\TBuild\\Libraries\\zlib-1.2.8\\contrib\\vstudio\\vc11\\zlibvc.sln** > One-way upgrade **OK**
* We are interested only in **zlibstat** project, but it depends on some custom pre-build step, so build all
* For **Debug** configuration
* zlibstat Properties > C/C++ > Code Generation > Runtime Library = **Multi-threaded Debug (/MTd)** **OK**
* For **Release** configuration
* zlibstat Properties > C/C++ > Code Generation > Runtime Library = **Multi-threaded (/MT)** **OK**
* Build Solution for Debug configuration only **zlibstat** project builds successfully
* Build Solution for Release configuration only **zlibstat** project builds successfully
### libexif 0.6.20
Go to **D:\\TBuild\\Libraries** and run
git clone https://github.com/telegramdesktop/libexif-0.6.20.git
#### Building library
* Open in VS2015 **D:\\TBuild\\Libraries\\libexif-0.6.20\\win32\\lib_exif.sln**
* Build Debug configuration
* Build Release configuration
### OpenAL Soft, slightly patched
Go to **D:\\TBuild\\Libraries** and run
git clone https://github.com/telegramdesktop/zlib.git
cd zlib
git checkout tdesktop
cd contrib\vstudio\vc14
msbuild zlibstat.vcxproj /property:Configuration=Debug
msbuild zlibstat.vcxproj /property:Configuration=ReleaseWithoutAsm
cd ..\..\..\..
git clone git://repo.or.cz/openal-soft.git
cd openal-soft
git checkout 18bb46163af
git apply ./../../tdesktop/Telegram/Patches/openal.diff
cd build
cmake -G "Visual Studio 15 2017" -D LIBTYPE:STRING=STATIC -D FORCE_STATIC_VCRT:STRING=ON ..
msbuild OpenAL32.vcxproj /property:Configuration=Debug
msbuild OpenAL32.vcxproj /property:Configuration=Release
cd ..\..
#### Building library
* Install [CMake](http://www.cmake.org/)
* Go to **D:\\TBuild\\Libraries\\openal-soft\\build** and run
<!-- -->
cmake -G "Visual Studio 14 2015" -D LIBTYPE:STRING=STATIC -D FORCE_STATIC_VCRT:STRING=ON ..
* Open in VS2015 **D:\\TBuild\\Libraries\\openal-soft\\build\\OpenAL.sln** and build Debug and Release configurations
### Opus codec
Go to **D:\\TBuild\\Libraries** and run
git clone https://github.com/google/breakpad
cd breakpad
git checkout a1dbcdcb43
git apply ../../tdesktop/Telegram/Patches/breakpad.diff
cd src
git clone https://github.com/google/googletest testing
cd client\windows
set GYP_MSVS_VERSION=2017
gyp --no-circular-check breakpad_client.gyp --format=ninja
cd ..\..
ninja -C out/Debug common crash_generation_client exception_handler
ninja -C out/Release common crash_generation_client exception_handler
cd ..\..
git clone https://github.com/telegramdesktop/opus.git
cd opus
git checkout ffmpeg_fix
git checkout tdesktop
cd win32\VS2015
msbuild opus.sln /property:Configuration=Debug /property:Platform="Win32"
msbuild opus.sln /property:Configuration=Release /property:Platform="Win32"
#### Building libraries
* Open in VS2015 **D:\\TBuild\\Libraries\\opus\\win32\\VS2015\\opus.sln**
* Build Debug configuration
* Build Release configuration (it will be required in **FFmpeg** build!)
### FFmpeg
Go to **D:\\TBuild\\Libraries** and run
cd ..
SET PATH_BACKUP_=%PATH%
SET PATH=%cd%\ThirdParty\msys64\usr\bin;%PATH%
cd Libraries
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
cd ffmpeg
git checkout release/3.2
http://www.msys2.org/ > Download the latest version and install it to **D:\\msys64**
set CHERE_INVOKING=enabled_from_arguments
set MSYS2_PATH_TYPE=inherit
bash --login ../../tdesktop/Telegram/Patches/build_ffmpeg_win.sh
#### Building libraries
Download [yasm for Win64](http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe) from http://yasm.tortall.net/Download.html, rename **yasm-1.3.0-win64.exe** to **yasm.exe** and place it to your Visual C++ **bin** directory, like **\\Program Files (x86)\\Microsoft Visual Studio 14\\VC\\bin\\**
While still running the VS2015 x86 Native Tools Command Prompt, go to **D:\\msys64** and launch **msys2_shell.bat**. There run
PATH="/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN:$PATH"
cd /d/TBuild/Libraries/ffmpeg
pacman -Sy
pacman -S msys/make
pacman -S mingw64/mingw-w64-x86_64-opus
pacman -S diffutils
pacman -S pkg-config
PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
./configure --toolchain=msvc --disable-programs --disable-doc --disable-everything --enable-protocol=file --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=flac --enable-decoder=gif --enable-decoder=h264 --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=mpeg4 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=pcm_alaw --enable-decoder=pcm_alaw_at --enable-decoder=pcm_f32be --enable-decoder=pcm_f32le --enable-decoder=pcm_f64be --enable-decoder=pcm_f64le --enable-decoder=pcm_lxf --enable-decoder=pcm_mulaw --enable-decoder=pcm_mulaw_at --enable-decoder=pcm_s16be --enable-decoder=pcm_s16be_planar --enable-decoder=pcm_s16le --enable-decoder=pcm_s16le_planar --enable-decoder=pcm_s24be --enable-decoder=pcm_s24daud --enable-decoder=pcm_s24le --enable-decoder=pcm_s24le_planar --enable-decoder=pcm_s32be --enable-decoder=pcm_s32le --enable-decoder=pcm_s32le_planar --enable-decoder=pcm_s64be --enable-decoder=pcm_s64le --enable-decoder=pcm_s8 --enable-decoder=pcm_s8_planar --enable-decoder=pcm_u16be --enable-decoder=pcm_u16le --enable-decoder=pcm_u24be --enable-decoder=pcm_u24le --enable-decoder=pcm_u32be --enable-decoder=pcm_u32le --enable-decoder=pcm_u8 --enable-decoder=pcm_zork --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-hwaccel=h264_d3d11va --enable-hwaccel=h264_dxva2 --enable-parser=aac --enable-parser=aac_latm --enable-parser=flac --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=flac --enable-demuxer=gif --enable-demuxer=h264 --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=wav --enable-muxer=ogg --enable-muxer=opus --extra-ldflags="-libpath:/d/TBuild/Libraries/opus/win32/VS2015/Win32/Release"
make
make install
### Qt 5.6.2, slightly patched
* Install Python 3.3.2 from https://www.python.org/download/releases/3.3.2 > [**Windows x86 MSI Installer (3.3.2)**](https://www.python.org/ftp/python/3.3.2/python-3.3.2.msi)
* Go to **D:\\TBuild\\Libraries** and run
<!-- -->
SET PATH=%PATH_BACKUP_%
git clone git://code.qt.io/qt/qt5.git qt5_6_2
cd qt5_6_2
perl init-repository --module-subset=qtbase,qtimageformats
git checkout v5.6.2
cd qtimageformats && git checkout v5.6.2 && cd ..
cd qtbase && git checkout v5.6.2 && cd ..
cd qtimageformats
git checkout v5.6.2
cd ..\qtbase
git checkout v5.6.2
git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff
#### Apply the patch
cd qtbase && git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_2.diff && cd ..
#### Install Windows SDKs
If you didn't install Windows SDKs before, you need to install them now. To install the SDKs just open Telegram solution at **D:\TBuild\tdesktop\Telegram.sln** ([jump here to generate Telegram.sln](#setup-gypninja-and-generate-vs-solution)) and on startup Visual Studio 2015 will popup dialog box and ask to download and install extra components (including Windows 7 SDK).
If you already have Windows SDKs then find the library folder and correct it at configure's command below (like **C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86**).
#### Building library
Go to **D:\\TBuild\\Libraries\\qt5_6_2** and run
configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "D:\TBuild\Libraries\openssl\Release\include" -L "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib" -l Gdi32 -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="D:\TBuild\Libraries\openssl_debug\Debug\lib\ssleay32.lib D:\TBuild\Libraries\openssl_debug\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="D:\TBuild\Libraries\openssl\Release\lib\ssleay32.lib D:\TBuild\Libraries\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015
nmake
nmake install
building (**nmake** command) will take really long time.
### Qt5Package
https://visualstudiogallery.msdn.microsoft.com/c89ff880-8509-47a4-a262-e4fa07168408
Download, close all VS2015 instances and install for VS2015
### Google Breakpad
Breakpad is a set of client and server components which implement a crash-reporting system.
#### Installation
##### depot_tools
Go to `D:\TBuild\Libraries` and run
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
cd depot_tools
gclient
If you get errors like
Cannot rebase: You have unstaged changes.
Please commit or stash them.
Failed to update depot_tools.
run `git reset --hard HEAD` and execute `gclient` again
##### Breakpad
configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "%cd%\..\openssl\Release\include" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\..\openssl\Debug\lib\ssleay32.lib %cd%\..\openssl\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\..\openssl\Release\lib\ssleay32.lib %cd%\..\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015
jom -j4
jom -j4 install
cd ..
mkdir breakpad && cd breakpad
..\depot_tools\fetch breakpad
..\depot_tools\gclient sync
xcopy src\src\* src /s /i
rmdir src\src /s /q
#### Build
cd ../tdesktop/Telegram
gyp\refresh.bat
* Open `D:\TBuild\Libraries\breakpad\src\client\windows\breakpad_client.sln` in VS2015
* Change `Treat WChar_t As Built in Type` to `No` in all projects & configurations (should be in Project -> Properties -> C/C++ -> Language)
* Change `Treat Warnings As Errors` to `No` in all projects & configurations (should be in Project -> Properties -> C/C++ -> General)
* Build Debug configuration
* Build Release configuration
## Building Telegram Desktop
#### Setup GYP/Ninja and generate VS solution
* Download [Ninja binaries](https://github.com/ninja-build/ninja/releases/download/v1.7.1/ninja-win.zip) and unpack them to **D:\\TBuild\\Libraries\\ninja** to have **D:\\TBuild\\Libraries\\ninja\\ninja.exe**
* Go to **D:\\TBuild\\Libraries** and run
<!-- -->
git clone https://chromium.googlesource.com/external/gyp
cd gyp
git checkout a478c1ab51
SET PATH=%PATH%;D:\TBuild\Libraries\gyp;D:\TBuild\Libraries\ninja;
cd ..\..\tdesktop\Telegram
Also, actually add **D:\\TBuild\\Libraries\\ninja\\** (not just for running the **gyp** command) to your path environment variable, since Telegram needs it for the build process.
## Build the project
If you want to pass a build define (like `TDESKTOP_DISABLE_AUTOUPDATE` or `TDESKTOP_DISABLE_NETWORK_PROXY`), call `set TDESKTOP_BUILD_DEFINES=TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_NETWORK_PROXY,...` (comma seperated string)
After, call `gyp\refresh.bat` (python 2.7 needed)
After, call **gyp\refresh.bat** once again.
#### Configure VS
* Launch VS2015 for configuring Qt5Package
* QT5 > Qt Options > Add
* Version name: **Qt 5.6.22Win32**
* Path: **D:\TBuild\Libraries\qt5_6_2\qtbase**
* If you made a network map, here you should use the real path! (e.g *C:\base_folder_for_telegram_dev* or what you used at the beginning)
* Default Qt/Win version: **Qt 5.6.2 Win32** **OK** - You may need to restart Visual Studio for this to take effect.
#### Build the project
* File > Open > Project/Solution > **D:\TBuild\tdesktop\Telegram\Telegram.sln**
* Open ***BuildPath*\\tdesktop\\Telegram\\Telegram.sln** in Visual Studio 2017
* Select Telegram project and press Build > Build Telegram (Debug and Release configurations)
* The result Telegram.exe will be located in **D:\TBuild\tdesktop\out\Debug** (and **Release**)
### Qt Visual Studio Tools
For better debugging you may want to install Qt Visual Studio Tools:
* Open **Tools** -> **Extensions and Updates...**
* Go to **Online** tab
* Search for **Qt**
* Install **Qt Visual Studio Tools** extension

View File

@ -57,16 +57,12 @@ From **/Users/user/TBuild/Libraries/macold** run
make -j4
sudo make install
#### zlib 1.2.8
#### zlib
http://www.zlib.net/ > Download [**zlib source code, version 1.2.8**](http://www.zlib.net/fossils/zlib-1.2.8.tar.gz)
Extract to **/Users/user/TBuild/Libraries/macold**
##### Building library
In Terminal go to **/Users/user/TBuild/Libraries/zlib-1.2.8** and run:
In Terminal go to **/Users/user/TBuild/Libraries** and run:
git clone https://github.com/telegramdesktop/zlib.git
cd zlib
prefix=/usr/local/macold CFLAGS="-mmacosx-version-min=10.6" LDFLAGS="-mmacosx-version-min=10.6" ./configure
make
sudo make install

View File

@ -22,16 +22,12 @@ In your build Terminal run:
to set minimal supported OS version to 10.8 for future console builds.
#### zlib 1.2.8
#### zlib
http://www.zlib.net/ > Download [**zlib source code, version 1.2.8**](http://www.zlib.net/fossils/zlib-1.2.8.tar.gz)
Extract to **/Users/user/TBuild/Libraries**
##### Building library
In Terminal go to **/Users/user/TBuild/Libraries/zlib-1.2.8** and run:
In Terminal go to **/Users/user/TBuild/Libraries/zlib** and run:
git clone https://github.com/telegramdesktop/zlib.git
cd zlib
CFLAGS="-mmacosx-version-min=10.8" LDFLAGS="-mmacosx-version-min=10.8" ./configure
make
sudo make install