From 096743ba5ea9a9f59e0c47dc666b3ce81030e1e4 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 7 Mar 2018 15:22:42 +0300 Subject: [PATCH] Update UWP README.md. GitOrigin-RevId: 177bbdd7e7ff8a0fc702b1ca366cb58883231f1c --- README.md | 2 +- example/uwp/README.md | 36 +++++++++++++++++------------------- example/uwp/build.ps1 | 1 - 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 65ae0acea..61f2832c1 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ .. * Install [vcpkg](https://github.com/Microsoft/vcpkg#quick-start). * Run the following commands to install `TDLib` dependencies using vcpkg: ``` -C:\src\vcpkg> .\vcpkg install openssl:x64-windows openssl:x86-windows zlib:x64-windows zlib:x86-windows +C:\src\vcpkg> .\vcpkg.exe install openssl:x64-windows openssl:x86-windows zlib:x64-windows zlib:x86-windows ``` * Build `TDLib` with CMake as explained in [building](#building), but instead of `cmake -DCMAKE_BUILD_TYPE=Release ..` use ``` diff --git a/example/uwp/README.md b/example/uwp/README.md index f34fcd1a3..b129d1bbc 100644 --- a/example/uwp/README.md +++ b/example/uwp/README.md @@ -1,33 +1,31 @@ # TDLib Universal Windows Platform example -Here are script for building TDLib SDK for universal windows platfrom and an example of its usage. +This is an example of building TDLib SDK for Universal Windows Platform and an example of its usage from C#. ## Building SDK -1. Install [vcpkg](https://github.com/Microsoft/vcpkg). - -2. With `vcpkg` install `zlib` and `openssl` for all UWP architectures. +* 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](https://cmake.org/download/). +* Install [vcpkg](https://github.com/Microsoft/vcpkg#quick-start) or update it to the latest version using `vcpkg update` and following received instructions. +* Install `zlib` and `openssl` for all UWP architectures using `vcpkg`: ``` -.\vcpkg.exe install openssl:arm-uwp openssl:arm64-uwp openssl:x64-uwp openssl:x86-uwp zlib:arm-uwp zlib:arm64-uwp zlib:x64-uwp zlib:x86-uwp +C:\src\vcpkg> .\vcpkg.exe install openssl:arm-uwp openssl:x64-uwp openssl:x86-uwp zlib:arm-uwp zlib:x64-uwp zlib:x86-uwp ``` -3. Install 7z. You may also use zip or winrar. - -4. Run build.ps1 with `powershell`. -Pass path to vcpkg as `-vcpkg-root` argument. +* Download and install [gperf](https://sourceforge.net/projects/gnuwin32/files/gperf/3.0.1/). Add the path to gperf.exe to the PATH environment variable. +* Download and install [7-Zip](http://www.7-zip.org/download.html) archiver, which is used by the `build.ps1` script to create a TDLib.UWP Visual Studio Extension. Add the path to 7z.exe to the PATH environment variable. + Alternatively `build.ps1` supports compressing using [WinRAR](https://en.wikipedia.org/wiki/WinRAR) with option `-compress winrar` and compressing using [zip](http://gnuwin32.sourceforge.net/packages/zip.htm) with `-compress zip`. +* Build `TDLib` using provided `build.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: ``` -.\build.ps1 -vcpkg-root "~\vcpkg\" +powershell -ExecutionPolicy ByPass .\build.ps1 -vcpkg_root C:\src\vcpkg ``` +If you need to restart the build from scratch, call `.\build.ps -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 by `build.ps1` script. -If you wish to use `zip` or `WinRAR` instead of `7z` pass `-compress zip` or `-compress winrar`. - -The build process will take a lot of time, as TDLib will be built for multiple -platforms in Debug and Release configurations. You may interrupt and resume the script at any moment. - -If you will need to restart the build from scratch, call `.\build.ps -mode "clean"` first. - -5. `tdlib.vsix` will be at `build-uwp\vsix\tdlib.vsix`. Open it and install the SDK. +Now `TDLib` can be freely used from any UWP project, built in Visual Studio. ## Example of usage -`app` directory contains a simple example of app for Universal Windows Plaform. Just open it with Visual Studio 2015 or 2017 and run. +The `app/` directory contains a simple example of a C# application for Universal Windows Platform. Just open it with Visual Studio 2015 or 2017 and run. + + diff --git a/example/uwp/build.ps1 b/example/uwp/build.ps1 index a106d0e02..3cfbea711 100644 --- a/example/uwp/build.ps1 +++ b/example/uwp/build.ps1 @@ -49,7 +49,6 @@ function config { ForEach($arch in $arch_list) { echo "Config Arch = [$arch]" - Remove-Item $arch -Force -Recurse -ErrorAction SilentlyContinue New-Item -ItemType Directory -Force -Path $arch cd $arch echo "${td_root}"