Skip to content

Commit

Permalink
Use RelWithDebInfo for UWP package (tdlib#1467)
Browse files Browse the repository at this point in the history
* Added -release_only flag for RelWithDebInfo
  • Loading branch information
FrayxRulez authored May 10, 2021
1 parent eecb047 commit 32fe645
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions example/uwp/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ param (
[string]$vcpkg_root = $(throw "-vcpkg_root=<path to vcpkg> is required"),
[string]$arch = "",
[string]$mode = "all",
[string]$compress = "7z"
[string]$compress = "7z",
[switch]$release_only = $false
)
$ErrorActionPreference = "Stop"

Expand Down Expand Up @@ -69,13 +70,27 @@ function build {
ForEach($arch in $arch_list) {
echo "Build Arch = [$arch]"
cd $arch
cmake --build . --config Release --target tddotnet
cmake --build . --config Debug --target tddotnet
if ($release_only) {
cmake --build . --config RelWithDebInfo --target tddotnet
} else {
cmake --build . --config Release --target tddotnet
cmake --build . --config Debug --target tddotnet
}
cd ..
}
cd ..
}

function export-architecture($arch, $config, $target) {
New-Item -ItemType Directory -Force -Path vsix/DesignTime/${target}/${arch}
New-Item -ItemType Directory -Force -Path vsix/Redist/${target}/${arch}
New-Item -ItemType Directory -Force -Path vsix/References/${target}/${arch}

cp ${arch}/${config}/* -include "SSLEAY*","LIBEAY*","libcrypto*","libssl*","zlib*" vsix/Redist/${target}/${arch}/
cp ${arch}/${config}/* -filter "Telegram.Td.*" -include "*.lib" vsix/DesignTime/${target}/${arch}/
cp ${arch}/${config}/* -filter "Telegram.Td.*" -include "*.pdb","*.dll" vsix/Redist/${target}/${arch}/
}

function export {
cd build-uwp
Remove-Item vsix -Force -Recurse -ErrorAction SilentlyContinue
Expand All @@ -86,22 +101,16 @@ function export {
cp ../LICENSE_1_0.txt vsix

ForEach($arch in $arch_list) {
New-Item -ItemType Directory -Force -Path vsix/DesignTime/Debug/${arch}
New-Item -ItemType Directory -Force -Path vsix/DesignTime/Retail/${arch}
New-Item -ItemType Directory -Force -Path vsix/Redist/Debug/${arch}
New-Item -ItemType Directory -Force -Path vsix/Redist/Retail/${arch}
New-Item -ItemType Directory -Force -Path vsix/References/CommonConfiguration/${arch}

cp ${arch}/Debug/* -include "SSLEAY*","LIBEAY*","libcrypto*","libssl*","zlib*" vsix/Redist/Debug/${arch}/
cp ${arch}/Release/* -include "SSLEAY*","LIBEAY*","libcrypto*","libssl*","zlib*" vsix/Redist/Retail/${arch}/

cp ${arch}/Debug/* -filter "Telegram.Td.*" -include "*.lib" vsix/DesignTime/Debug/${arch}/
cp ${arch}/Release/* -filter "Telegram.Td.*" -include "*.lib" vsix/DesignTime/Retail/${arch}/

cp ${arch}/Debug/* -filter "Telegram.Td.*" -include "*.pdb","*.dll" vsix/Redist/Debug/${arch}/
cp ${arch}/Release/* -filter "Telegram.Td.*" -include "*.pdb","*.dll" vsix/Redist/Retail/${arch}/

cp ${arch}/Release/* -filter "Telegram.Td.*" -include "*.pri","*.winmd","*.xml" vsix/References/CommonConfiguration/${arch}/
if ($release_only) {
New-Item -ItemType Directory -Force -Path vsix/References/CommonConfiguration/${arch}
export-architecture -arch $arch -config "RelWithDebInfo" -target "CommonConfiguration"
cp ${arch}/RelWithDebInfo/* -filter "Telegram.Td.*" -include "*.pri","*.winmd","*.xml" vsix/References/CommonConfiguration/${arch}/
} else {
New-Item -ItemType Directory -Force -Path vsix/References/CommonConfiguration/${arch}
export-architecture -arch $arch -config "Debug" -target "Debug"
export-architecture -arch $arch -config "Release" -target "Retail"
cp ${arch}/Release/* -filter "Telegram.Td.*" -include "*.pri","*.winmd","*.xml" vsix/References/CommonConfiguration/${arch}/
}
}

cd vsix
Expand Down

0 comments on commit 32fe645

Please sign in to comment.