mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 13:16:53 +00:00
Other: fix passing build time argument to CMake for windows [skip-ci]
This commit is contained in:
@ -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()
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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:]')
|
||||
|
||||
Reference in New Issue
Block a user