windows 编译telegram桌面客户端

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

目的

主要是为了研究一下人家的软件架构。

步骤

前置条件

  1. 梯子
  2. 至少10G硬盘空间

安装第三方应用

请更新至最新版。

  1. GIT
  2. Cmake
  3. Python3
  4. visual studio 2022
  5. Qt Visual Studio Tools: Open Extensions -> Manage Extensions Go to Online tab Search for Qt Install Qt Visual Studio Tools extension

准备文件夹

新建一个文件夹这个文件夹的全路径用BuildPath指代。比如我是F:\TestBuild\TBuild ==BuildPath
BuildPath下创建两个文件夹LibrariesThirdParty
准备文件夹

编译工具链

需要使用最新的MSVC进行编译所以需要安装visual studio 2022 一般选择vs c++ 桌面开发即可。
所有命令需要通过VS提供的x64 Native Tools Command Prompt for VS 2022.bat 命令行环境运行。这个命令行可以在开始菜单文件夹下找到比如我是C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2022\Visual Studio Tools\VC下。
命令环境

获得API许可

需要去注册账号参考说明
或者有测试账号api_id: 17349 api_hash: 344583e45741c457fe1862106095a5eb但是功能被限制了很多。

克隆环境

x64 Native Tools Command Prompt for VS 2022.bat这个命令环境里进入BuildPath文件夹运行命令

git clone --recursive https://github.com/telegramdesktop/tdesktop.git
tdesktop\Telegram\build\prepare\win.bat

在这里插入图片描述

Build

进入 BuildPath\tdesktop\Telegram 使用你的api_id api_hash运行。比如
替换其中的YOUR_API_ID YOUR_API_HASH

configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH
  1. 使用VS2022 打开BuildPath\tdesktop\out\Telegram.sln
  2. 选择项目 Build > Build Telegram (Debug and Release configurations)
  3. 可执行文件在 \tdesktop\out\Debug (and Release)
阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: windows