From 3ec9d695560d2483b4fe92e899a197477dab7ef6 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 9 Feb 2026 12:13:37 +0500 Subject: [PATCH] build-deps - support building Boost for VS2026 --- win/build-deps.cmd | 14 ++++++++++++++ win/utils/tools.ps1 | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/win/build-deps.cmd b/win/build-deps.cmd index f55b27043d..811f381f19 100644 --- a/win/build-deps.cmd +++ b/win/build-deps.cmd @@ -414,6 +414,11 @@ if exist "%DEPS_DIR%\boost-%BOOST_VERSION%". ( ren %DEPS_DIR%\boost-%BOOST_VERSION% boost_%BOOST_VER% ) +:: As boost 1.90.0 it still includes b2 that doesn't support vc145 (not to mention older boost versions). +:: So to support vc145 we download b2 separately (only if we do use vc145). +call :check_boost_vc145_compatibility "%VC_VER%" "%DEPS_DIR%" "%DEPENDENCY_DIR%" +if NOT %ERRORLEVEL%==0 GOTO :Error + :: Build Boost build script if not exist "%DEPENDENCY_DIR%\project-config.jam". ( cd "%DEPS_DIR%" @@ -930,6 +935,15 @@ exit /b 0 IF NOT %ERRORLEVEL%==0 GOTO :Error exit /b 0 +:: Params: +:: - %1 - VC_VER +:: - %2 - DEPS_DIR +:: - %3 - BOOST_ROOT +:check_boost_vc145_compatibility +%PWSH_TOOLS% check_boost_vc145_compatibility "%1" "%2" "%3" +IF NOT %ERRORLEVEL%==0 GOTO :Error +exit /b 0 + :: PrintUsage - Prints usage information :PrintUsage call "%~dp0\utils\cecho.cmd" 0 10 "Requirements for a successful execution:" diff --git a/win/utils/tools.ps1 b/win/utils/tools.ps1 index 322e306651..583e4cfb3b 100644 --- a/win/utils/tools.ps1 +++ b/win/utils/tools.ps1 @@ -219,6 +219,43 @@ function install_cmake_project { } +function check_boost_vc145_compatibility { + param( + [Parameter(Mandatory = $true)] + [string]$VC_VER, + [Parameter(Mandatory = $true)] + [string]$DEPS_DIR, + [Parameter(Mandatory = $true)] + [string]$BOOST_ROOT + ) + + $boost_build_path = "$BOOST_ROOT/tools/build" + + if ($VC_VER -ne "14.5") { + . $cecho 0 13 "VC_VER is not 14.5, no need to install updated b2." + return + } + + $res = Select-String -Path "$boost_build_path/src/engine/build.bat" -Pattern 'vc143, vc145' -Quiet; + if ($res) { + . $cecho 0 13 "vc145 already supported, no need to install updated b2." + return + } + + $b2_version = "5.4.2" + $b2_stem = "b2-$b2_version" + $b2_path = "$DEPS_DIR\$b2_stem" + $b2_filename = "$b2_stem.zip" + + & download_file "b2" "https://github.com/bfgroup/b2/releases/download/$b2_version/$b2_filename" "$DEPS_DIR" "$b2_filename" + & extract_file "b2" "$b2_filename" "$DEPS_DIR" "$b2_path" + + . $cecho 0 13 "Installing b2 with vc145 support..." + Remove-Item -Recurse -Path "$boost_build_path" + Copy-Item -Path "$b2_path" -Destination "$boost_build_path" -Recurse + . $cecho 0 13 "b2 with vc145 support installed." +} + function main { & setup_build_cfg # Dispatch command.