Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UWP build script #3134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/uwp/SDKManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
AppliesTo="WindowsAppContainer"
DependsOn="Microsoft.VCLibs, version=14.0"
SupportsMultipleVersions="Error"
SupportedArchitectures="x86;x64;ARM">
SupportedArchitectures="x86;x64;ARM;ARM64">
<File Reference="Telegram.Td.winmd" Implementation="Telegram.Td.dll" />
</FileList>
17 changes: 8 additions & 9 deletions example/uwp/build.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
param (
[string]$vcpkg_root = $(throw "-vcpkg_root=<path to vcpkg> is required"),
[string]$arch = "",
[ValidateSet('x86', 'x64', 'ARM', 'ARM64', IgnoreCase = $false)]
[string[]]$arch = @( "x86", "x64", "ARM", "ARM64" ),
[string]$mode = "all",
[string]$compress = "7z",
[switch]$release_only = $false,
Expand All @@ -11,10 +12,7 @@ $ErrorActionPreference = "Stop"
$vcpkg_root = Resolve-Path $vcpkg_root

$vcpkg_cmake="${vcpkg_root}\scripts\buildsystems\vcpkg.cmake"
$arch_list = @( "x86", "x64", "ARM", "ARM64" )
if ($arch) {
$arch_list = @(, $arch)
}
$arch_list = $arch
$config_list = @( "Debug", "Release" )
if ($release_only -or $nupkg) {
$config_list = @(, "RelWithDebInfo")
Expand Down Expand Up @@ -56,7 +54,7 @@ function config {

ForEach ($arch in $arch_list) {
echo "Config Arch = [$arch]"
New-Item -ItemType Directory -Force -Path $arch
New-Item -ItemType Directory -Force -Path $arch.ToLower()
cd $arch
echo "${td_root}"
$fixed_arch = $arch
Expand Down Expand Up @@ -130,12 +128,13 @@ function export-nupkg {
cp ../Telegram.Td.UWP.targets nupkg/build/native

ForEach ($arch in $arch_list) {
New-Item -ItemType Directory -Force -Path nupkg/runtimes/win10-${arch}/native
$fixed_arch = $arch.ToLower();
New-Item -ItemType Directory -Force -Path nupkg/runtimes/win10-${fixed_arch}/native
New-Item -ItemType Directory -Force -Path nupkg/lib/uap10.0

ForEach ($config in $config_list) {
cp ${arch}/${config}/* -include "SSLEAY*","LIBEAY*","libcrypto*","libssl*","zlib*","Telegram.Td.pdb","Telegram.Td.pri","Telegram.Td.dll" nupkg/runtimes/win10-${arch}/native
cp ${arch}/${config}/* -include "Telegram.Td.winmd","Telegram.Td.xml" nupkg/lib/uap10.0
cp ${fixed_arch}/${config}/* -include "SSLEAY*","LIBEAY*","libcrypto*","libssl*","zlib*","Telegram.Td.pdb","Telegram.Td.pri","Telegram.Td.dll" nupkg/runtimes/win10-${fixed_arch}/native
cp ${fixed_arch}/${config}/* -include "Telegram.Td.winmd","Telegram.Td.xml" nupkg/lib/uap10.0
}
}

Expand Down