Update building-msvc.md (#3264)

* Update building-msvc.md

Fixed some wrong, missing or unclear parts. Based on the problems I came into when trying to build and configure everything.

Ninja not in path - from #3237
Newer msys - from #3247
Telegram.sln - from #2811

* Updated from the PR comments and added a signature


Signed-off-by: Ariel Jannai <arieljannai@gmail.com> (github: arieljannai)

* Updated by the latest comments from the PR

Signed-off-by: Ariel Jannai <arieljannai@gmail.com> (github: arieljannai)
This commit is contained in:
Ariel Jannai 2017-04-14 12:58:10 +03:00 committed by Christoph
parent dd005d9027
commit bf0bf908c2

View File

@ -37,6 +37,12 @@ Choose a folder for the future build, for example **D:\\TBuild\\**. There you wi
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).
#### A note on D:\\TBuild
***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: `net use D: \\localhost\c$\base_folder_for_telegram_dev`.
## Clone source code
Go to **D:\\TBuild**
@ -158,7 +164,7 @@ Go to **D:\\TBuild\\Libraries** and run
cd ffmpeg
git checkout release/3.2
http://msys2.github.io/ > Download [msys2-x86_64-20150512.exe](http://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-x86_64-20150512.exe/download) and install to **D:\\msys64**
http://www.msys2.org/ > Download the latest version and install it to **D:\\msys64**
#### Building libraries
@ -202,7 +208,7 @@ While still running the VS2015 x86 Native Tools Command Prompt, go to **D:\\msys
#### 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** and on startup Visual Studio 2015 will popup dialog box and ask to download and install extra components (including Windows 7 SDK).
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**).
@ -273,17 +279,20 @@ run `git reset --hard HEAD` and execute `gclient` again
git clone https://chromium.googlesource.com/external/gyp
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.
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`
After, call `gyp\refresh.bat` (python 2.7 needed)
#### 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**
* 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