11param (
2+ [Parameter (Mandatory = $false )][string ]$repository ,
23 [Parameter (Mandatory = $true )][string ]$tag
34)
45
6+ if ( -not $repository )
7+ {
8+ $repository = " https://github.com/mellinoe/imgui.net-nativebuild"
9+ }
10+
511Write-Host Downloading native binaries from GitHub Releases...
612
713if (Test-Path $PSScriptRoot \deps\cimgui\)
814{
915 Remove-Item $PSScriptRoot \deps\cimgui\ - Force - Recurse | Out-Null
1016}
1117New-Item - ItemType Directory - Force - Path $PSScriptRoot \deps\cimgui\linux- x64 | Out-Null
12- New-Item - ItemType Directory - Force - Path $PSScriptRoot \deps\cimgui\osx- x64 | Out-Null
18+ New-Item - ItemType Directory - Force - Path $PSScriptRoot \deps\cimgui\osx- universal | Out-Null
1319New-Item - ItemType Directory - Force - Path $PSScriptRoot \deps\cimgui\win- x86 | Out-Null
1420New-Item - ItemType Directory - Force - Path $PSScriptRoot \deps\cimgui\win- x64 | Out-Null
1521
1622[Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12
1723
1824$client = New-Object System.Net.WebClient
1925$client.DownloadFile (
20- " https://github.com/mellinoe/imgui.net-nativebuild /releases/download/$tag /cimgui.win-x86.dll" ,
26+ " $repository /releases/download/$tag /cimgui.win-x86.dll" ,
2127 " $PSScriptRoot /deps/cimgui/win-x86/cimgui.dll" )
2228if ( -not $? )
2329{
@@ -29,7 +35,7 @@ if( -not $? )
2935Write-Host " - cimgui.dll (x86)"
3036
3137$client.DownloadFile (
32- " https://github.com/mellinoe/imgui.net-nativebuild /releases/download/$tag /cimgui.win-x64.dll" ,
38+ " $repository /releases/download/$tag /cimgui.win-x64.dll" ,
3339 " $PSScriptRoot /deps/cimgui/win-x64/$configuration /cimgui.dll" )
3440if ( -not $? )
3541{
@@ -41,7 +47,7 @@ if( -not $? )
4147Write-Host " - cimgui.dll (x64)"
4248
4349$client.DownloadFile (
44- " https://github.com/mellinoe/imgui.net-nativebuild /releases/download/$tag /cimgui.so" ,
50+ " $repository /releases/download/$tag /cimgui.so" ,
4551 " $PSScriptRoot /deps/cimgui/linux-x64/cimgui.so" )
4652if ( -not $? )
4753{
@@ -53,16 +59,16 @@ if( -not $? )
5359Write-Host - cimgui.so
5460
5561$client.DownloadFile (
56- " https://github.com/mellinoe/imgui.net-nativebuild /releases/download/$tag /cimgui.dylib" ,
57- " $PSScriptRoot /deps/cimgui/osx-x64 /cimgui.dylib" )
62+ " $repository /releases/download/$tag /cimgui.dylib" ,
63+ " $PSScriptRoot /deps/cimgui/osx-universal /cimgui.dylib" )
5864if ( -not $? )
5965{
6066 $msg = $Error [0 ].Exception.Message
6167 Write-Error " Couldn't download cimgui.dylib. This most likely indicates the macOS native build failed."
6268 exit
6369}
6470
65- Write-Host - cimgui.dylib
71+ Write-Host " - cimgui.dylib"
6672
6773$client.DownloadFile (
6874 " https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag /definitions.json" ,
@@ -86,4 +92,4 @@ if( -not $? )
8692 exit
8793}
8894
89- Write-Host - structs_and_enums.json
95+ Write-Host - structs_and_enums.json
0 commit comments