forked from open-eid/libdigidocpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_win_build_environment.ps1
37 lines (32 loc) · 1.12 KB
/
prepare_win_build_environment.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#powershell -ExecutionPolicy ByPass -File prepare_win_build_environment.ps1 [-dependencies] [-xsd]
param(
[string]$vcpkg = "vcpkg\vcpkg.exe",
[string]$git = "git.exe",
[switch]$xsd = $false,
[switch]$dependencies = $false
)
function xsd() {
$client = new-object System.Net.WebClient
& mkdir xsd
foreach($xsdver in @("xsd-4.2.0-x86_64-windows10", "libxsd-4.2.0-windows")) {
$client.DownloadFile("https://www.codesynthesis.com/download/xsd/4.2/windows/windows10/x86_64/$xsdver.zip", "$PSScriptRoot\$xsdver.zip")
& tar xf "$xsdver.zip"
& xcopy /e /r /y $xsdver\*.* xsd
& Remove-Item $xsdver -Force -Recurse -ErrorAction Ignore
}
}
if($xsd) {
xsd
}
if($dependencies) {
if(!(Test-Path -Path $vcpkg)) {
$vcpkg_dir = (split-path -parent $vcpkg)
& $git clone --depth 1 https://github.com/microsoft/vcpkg $vcpkg_dir
& $vcpkg_dir\bootstrap-vcpkg.bat
}
& $vcpkg install --clean-after-build --triplet x86-windows --x-feature=tests --x-install-root=vcpkg_installed_x86
& $vcpkg install --clean-after-build --triplet x64-windows --x-feature=tests --x-install-root=vcpkg_installed_x64
}
if(!$xsd -and !$dependencies) {
xsd
}