From 691dc42eeafb411d269df1e2d0543906c00fb718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuli=20Sepp=C3=A4nen?= Date: Thu, 19 Aug 2021 13:16:11 +0000 Subject: [PATCH] Allow running build-msvc.ps1 from anywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Samuli Seppänen --- build-msvc.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build-msvc.ps1 b/build-msvc.ps1 index 5e8952457..5ad7c9636 100644 --- a/build-msvc.ps1 +++ b/build-msvc.ps1 @@ -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