Skip to content

Commit

Permalink
Improve UWP build script
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Nov 10, 2024
1 parent 18618ca commit 172d71a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
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

0 comments on commit 172d71a

Please sign in to comment.