forked from ImGuiNET/ImGui.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
download-native-deps.ps1
executable file
·108 lines (90 loc) · 3.31 KB
/
download-native-deps.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
param (
[Parameter(Mandatory=$false)][string]$repository,
[Parameter(Mandatory=$true)][string]$tag
)
if( -not $repository )
{
$repository="https://github.com/mellinoe/imgui.net-nativebuild"
}
Write-Host Downloading native binaries from GitHub Releases...
if (Test-Path $PSScriptRoot\deps\cimgui\)
{
Remove-Item $PSScriptRoot\deps\cimgui\ -Force -Recurse | Out-Null
}
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\linux-x64 | Out-Null
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\osx | Out-Null
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\win-x86 | Out-Null
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\win-x64 | Out-Null
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\win-arm64 | Out-Null
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$client = New-Object System.Net.WebClient
$client.DownloadFile(
"$repository/releases/download/$tag/cimgui.win-x86.dll",
"$PSScriptRoot/deps/cimgui/win-x86/cimgui.dll")
if( -not $? )
{
$msg = $Error[0].Exception.Message
Write-Error "Couldn't download x86 cimgui.dll. This most likely indicates the Windows native build failed."
exit
}
Write-Host "- cimgui.dll (x86)"
$client.DownloadFile(
"$repository/releases/download/$tag/cimgui.win-x64.dll",
"$PSScriptRoot/deps/cimgui/win-x64/$configuration/cimgui.dll")
if( -not $? )
{
$msg = $Error[0].Exception.Message
Write-Error "Couldn't download x64 cimgui.dll. This most likely indicates the Windows native build failed."
exit
}
Write-Host "- cimgui.dll (x64)"
$client.DownloadFile(
"$repository/releases/download/$tag/cimgui.win-arm64.dll",
"$PSScriptRoot/deps/cimgui/win-arm64/$configuration/cimgui.dll")
if( -not $? )
{
$msg = $Error[0].Exception.Message
Write-Error "Couldn't download arm64 cimgui.dll. This most likely indicates the Windows native build failed."
exit
}
Write-Host "- cimgui.dll (arm64)"
$client.DownloadFile(
"$repository/releases/download/$tag/cimgui.so",
"$PSScriptRoot/deps/cimgui/linux-x64/cimgui.so")
if( -not $? )
{
$msg = $Error[0].Exception.Message
Write-Error "Couldn't download cimgui.so. This most likely indicates the Linux native build failed."
exit
}
Write-Host - cimgui.so
$client.DownloadFile(
"$repository/releases/download/$tag/cimgui.dylib",
"$PSScriptRoot/deps/cimgui/osx/cimgui.dylib")
if( -not $? )
{
$msg = $Error[0].Exception.Message
Write-Error "Couldn't download cimgui.dylib. This most likely indicates the macOS native build failed."
exit
}
Write-Host "- cimgui.dylib"
$client.DownloadFile(
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/definitions.json",
"$PSScriptRoot/src/CodeGenerator/definitions/cimgui/definitions.json")
if( -not $? )
{
$msg = $Error[0].Exception.Message
Write-Error "Couldn't download definitions.json."
exit
}
Write-Host - definitions.json
$client.DownloadFile(
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/structs_and_enums.json",
"$PSScriptRoot/src/CodeGenerator/definitions/cimgui/structs_and_enums.json")
if( -not $? )
{
$msg = $Error[0].Exception.Message
Write-Error "Couldn't download structs_and_enums.json."
exit
}
Write-Host - structs_and_enums.json