Other: fix passing build time argument to CMake for windows [skip-ci]

This commit is contained in:
Romain LE JEUNE
2022-08-23 10:20:23 +02:00
committed by Jakub
parent 275a92ae93
commit 796c617569
3 changed files with 22 additions and 3 deletions

View File

@ -40,8 +40,6 @@ else()
message(STATUS "App vendor is ${BRIDGE_VENDOR}")
endif()
if (NOT DEFINED BRIDGE_APP_VERSION)
message(FATAL_ERROR "BRIDGE_APP_VERSION is not defined.")
else()

View File

@ -32,12 +32,27 @@ if ($null -eq $cmakeExe)
$cmakeExe = "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" # Hardcoded for now.
}
Write-host "CMake found here : $cmakeExe"
$cmake_version = . $cmakeExe --version
Write-host "CMake version : $cmake_version"
$bridgeVersion = ($env:BRIDGE_APP_VERSION)
if ($null -eq $bridgeVersion)
{
$bridgeVersion = . (Join-Path $bridgeRepoRootDir "utils/bridge_app_version.ps1")
}
$bridgeFullName = ($env:BRIDGE_APP_FULL_NAME)
if ($null -eq $bridgeFullName)
{
$bridgeFullName = "Proton Bridge"
}
$bridgeVendor = ($env:BRIDGE_VENDOR)
if ($null -eq $bridgeVendor)
{
$bridgeVendor = "Proton AG"
}
$buildConfig = ($env:BRIDGE_GUI_BUILD_CONFIG)
if ($null -eq $buildConfig)
{
@ -64,7 +79,12 @@ git submodule update --init --recursive $vcpkgRoot
. $vcpkgBootstrap -disableMetrics
. $vcpkgExe install grpc:x64-windows --clean-after-build
. $vcpkgExe upgrade --no-dry-run
. $cmakeExe -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE="$buildConfig" -DBRIDGE_APP_VERSION="$bridgeVersion" -S . -B $buildDir
. $cmakeExe -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE="$buildConfig" `
-DBRIDGE_APP_FULL_NAME="$bridgeFullName" `
-DBRIDGE_VENDOR="$bridgeVendor" `
-DBRIDGE_APP_VERSION="$bridgeVersion" `
-S . -B $buildDir
check_exit "CMake failed"
. $cmakeExe --build $buildDir --config "$buildConfig"
check_exit "Build failed"

View File

@ -25,6 +25,7 @@ fi
BRIDGE_REPO_ROOT="../../../.."
BRIDGE_INSTALL_PATH=${BRIDGE_INSTALL_PATH:-deploy}
BRIDGE_APP_VERSION=${BRIDGE_APP_VERSION:-$("${BRIDGE_REPO_ROOT}/utils/bridge_app_version.sh")}
BRIDGE_APP_FULL_NAME=${BRIDGE_APP_FULL_NAME:-"Proton Bridge"}
BRIDGE_VENDOR=${BRIDGE_VENDOR:-"Proton AG"}
BUILD_CONFIG=${BRIDGE_GUI_BUILD_CONFIG:-Debug}
BUILD_DIR=$(echo "./cmake-build-${BUILD_CONFIG}" | tr '[:upper:]' '[:lower:]')