45e855f89d
I can't maintain anymore this amount of features while keeping the library constantly updated and without bugs. Every merge was taking me multiple hours of revisioning the code. I give up. From this commit onwards TDLight will only have small useful customizations that are easy to maintain. Now the people relying on the OptimizeMemory method can restart the session every N hours to free up the memory. The real way to keep a low memory usage must involve a huge refactoring to allow the unloading of the caches into the sqlite database, similar to what's already happening with messages data. Only Levlam has the ability to implement this without needing to merge the upstream everytime. |
||
---|---|---|
.. | ||
app | ||
[Content_Types].xml | ||
build.ps1 | ||
extension.vsixmanifest | ||
LICENSE_1_0.txt | ||
README.md | ||
SDKManifest.xml |
TDLib Universal Windows Platform example
This is an example of building TDLib SDK for Universal Windows Platform and an example of its usage from C#.
Building SDK
- Download and install Microsoft Visual Studio 2015+ with Windows 10 SDK. We recommend to use the latest available versions of Microsoft Visual Studio and Windows 10 SDK.
- Download and install CMake.
- Install vcpkg or update it to the latest version using
vcpkg update
and following received instructions. - Install
zlib
andopenssl
for all UWP architectures andgperf
for x86 usingvcpkg
:
cd <path to vcpkg>
.\vcpkg.exe install gperf:x86-windows openssl:arm-uwp openssl:arm64-uwp openssl:x64-uwp openssl:x86-uwp zlib:arm-uwp zlib:arm64-uwp zlib:x64-uwp zlib:x86-uwp
- (Optional. For XML documentation generation.) Download PHP. Add the path to php.exe to the PATH environment variable.
- Download and install 7-Zip archiver, which is used by the
build.ps1
script to create a Telegram.Td.UWP Visual Studio Extension. Add the path to 7z.exe to the PATH environment variable. Alternativelybuild.ps1
supports compressing using WinRAR with option-compress winrar
and compressing using zip with-compress zip
. - Build
TDLib
using providedbuild.ps1
script (TDLib should be built 6 times for multiple platforms in Debug and Release configurations, so it make take few hours). Pass path to vcpkg.exe as-vcpkg-root
argument, for example:
powershell -ExecutionPolicy ByPass .\build.ps1 -vcpkg_root C:\vcpkg
If you need to restart the build from scratch, call .\build.ps1 -vcpkg_root ../../vcpkg -mode clean
first.
- Install Visual Studio Extension "TDLib for Universal Windows Platform" located at
build-uwp\vsix\tdlib.vsix
, which was created on the previous step bybuild.ps1
script.
Now TDLib
can be used from any UWP project, built in Visual Studio.
Example of usage
The app/
directory contains a simple example of a C# application for Universal Windows Platform. Just open it with Visual Studio 2015 or later and run.