Skip to content

Commit

Permalink
Update build powershell script for vs2022
Browse files Browse the repository at this point in the history
Also ask to build x64/win32 builds separately in case one fails but not the other
  • Loading branch information
sirjuddington committed Apr 1, 2023
1 parent 5cc2d92 commit 94f52f8
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions dist/makebuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,33 @@ $buildbinaries = Read-Host
if ($buildbinaries.ToLower() -eq "y")
{
# Find devenv path (community or professional)
$devenvpath19 = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.com"
if (-not (Test-Path $devenvpath19))
$devenvpath = "${env:ProgramFiles}\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.com"
if (-not (Test-Path $devenvpath))
{
$devenvpath19 = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.com"
$devenvpath = "${env:ProgramFiles}\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.com"
}
if (-not (Test-Path $devenvpath19))
if (-not (Test-Path $devenvpath))
{
Write-Host "`nCould not find Visual Studio 2019 path" -ForegroundColor Red
Write-Host "`nCould not find Visual Studio 2022 path" -ForegroundColor Red
Exit-PSSession
}
else
{
& $devenvpath19 (resolve-path ..\msvc\SLADE.sln).Path /rebuild "Release|Win32" /project SLADE.vcxproj
& $devenvpath19 (resolve-path ..\msvc\SLADE.sln).Path /rebuild "Release|x64" /project SLADE.vcxproj
Write-Host "`nFound VS2022 at ${devenvpath}";

Write-Host "`nProceed with 64bit build? (y/n) " -foregroundcolor cyan -nonewline
$build64 = Read-Host
if ($build64.ToLower() -eq "y")
{
& $devenvpath (resolve-path ..\msvc\SLADE.sln).Path /rebuild "Release|x64" /project SLADE.vcxproj
}

Write-Host "`nProceed with 32bit build? (y/n) " -foregroundcolor cyan -nonewline
$build32 = Read-Host
if ($build32.ToLower() -eq "y")
{
& $devenvpath (resolve-path ..\msvc\SLADE.sln).Path /rebuild "Release|Win32" /project SLADE.vcxproj
}
}
}

Expand Down

0 comments on commit 94f52f8

Please sign in to comment.