Skip to content

Commit

Permalink
Allow running build-msvc.ps1 from anywhere
Browse files Browse the repository at this point in the history
Signed-off-by: Samuli Seppänen <[email protected]>
  • Loading branch information
mattock committed Aug 19, 2021
1 parent fe5d45b commit 691dc42
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build-msvc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ $CWD = Get-Location
$CMAKE="C:\Program Files\CMake\bin\cmake.exe"
$CMAKE_TOOLCHAIN_FILE="C:\users\vagrant\buildbot\windows-server-2019-static-msbuild\vcpkg\scripts\buildsystems\vcpkg.cmake"

# Enable running this script from anywhere
cd $PSScriptRoot

# Architecture names taken from here:
#
# https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160
"x64", "arm64", "Win32" | ForEach {
$platform = $_
Write-Host "Building openvpn-gui ${platform}"
mkdir build_$platform
if ( ( Test-Path "build_${platform}" ) -eq $False )
{
mkdir build_$platform
}
cd build_$platform
& "$CMAKE" -A $platform -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE" ..
& "$CMAKE" --build . --config Release
Expand Down

0 comments on commit 691dc42

Please sign in to comment.