Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to build with cmake #444

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions build-msvc.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Build openvpn-gui with MSVC

$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}"
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
cd $PSScriptRoot
}

cd $CWD