Skip to content

Commit

Permalink
Support of Boost 1.83.0 in boost-msvc-2022 image (VS 2022 17.10, boos…
Browse files Browse the repository at this point in the history
  • Loading branch information
mabrarov committed Oct 27, 2024
1 parent 2511ddd commit 0f7f085
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docker/boost-msvc-2022/src/app/bootstrap.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ rem

set exit_code=0

if not "--%BOOST_PATCH_FILE%" == "--" (
setlocal
set "PATH=%MSYS_HOME%\usr\bin;%PATH%"

patch -uNf -p0 -i "%BOOST_PATCH_FILE%"
set exit_code=%errorlevel%
if %exit_code% neq 0 (
if %exit_code% neq 1 (
endlocal
goto exit
)
)

endlocal

rem Reset errorlevel to zero
cmd /c "exit /b 0"
)

call "%MSVC_BUILD_DIR%\%MSVC_CMD_BOOTSTRAP%"
set exit_code=%errorlevel%
if %exit_code% neq 0 goto exit
Expand Down
50 changes: 50 additions & 0 deletions docker/boost-msvc-2022/src/app/patches/boost-1.83.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
--- ./tools/build/src/tools/msvc.jam 2024-10-27 01:03:50.705233500 +0300
+++ ./tools/build/src/tools/msvc.jam 2024-10-27 01:03:50.705233500 +0300
@@ -23,6 +23,7 @@
tools on Microsoft Windows. The supported products and versions of
command line tools are listed below:

+* Visual Studio 2019-14.3
* Visual Studio 2019-14.2
* Visual Studio 2017—14.1
* Visual Studio 2015—14.0
@@ -1137,7 +1138,7 @@
}
else
{
- if [ MATCH "(14.3)" : $(version) ]
+ if [ MATCH "(14.[34])" : $(version) ]
{
if $(.debug-configuration)
{
@@ -1316,7 +1317,7 @@
# version from the path.
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
# 9.0express as 9.0 here.
- if [ MATCH "(MSVC\\\\14.3)" : $(command) ]
+ if [ MATCH "(MSVC\\\\14.[34])" : $(command) ]
{
version = 14.3 ;
}
--- ./boost/config/compiler/visualc.hpp 2023-08-09 00:02:55.000000000 +0300
+++ ./boost/config/compiler/visualc.hpp 2023-08-09 00:02:55.000000000 +0300
@@ -365,7 +365,7 @@
# define BOOST_COMPILER_VERSION 14.1
# elif _MSC_VER < 1930
# define BOOST_COMPILER_VERSION 14.2
-# elif _MSC_VER < 1940
+# elif _MSC_VER < 1950
# define BOOST_COMPILER_VERSION 14.3
# else
# define BOOST_COMPILER_VERSION _MSC_VER
@@ -378,8 +378,8 @@
#include <boost/config/pragma_message.hpp>

//
-// last known and checked version is 19.3x (VS2022):
-#if (_MSC_VER >= 1940)
+// last known and checked version is 19.4x (VS2022 17.10):
+#if (_MSC_VER >= 1950)
# if defined(BOOST_ASSERT_CONFIG)
# error "Boost.Config is older than your current compiler version."
# elif !defined(BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE)
9 changes: 9 additions & 0 deletions docker/boost-msvc-2022/src/app/start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ if (Test-Path -Path "${env:BOOST_ROOT_DIR}") {
$env:B2_BIN = "${env:BOOST_ROOT_DIR}\b2.exe"
$env:B2_TOOLSET = "msvc-14.3"

# Prepare patch for Boost
if (-not (Test-Path env:BOOST_PATCH_FILE)) {
$env:BOOST_PATCH_FILE = "${PSScriptRoot}\patches\boost-${env:BOOST_VERSION}.patch"
}
if (-not (Test-Path -Path "${env:BOOST_PATCH_FILE}")) {
Write-Warning "Patch for chosen version of Boost (${env:BOOST_VERSION}) was not found at ${env:BOOST_PATCH_FILE}"
$env:BOOST_PATCH_FILE = ""
}

# Build Boost.Build
$env:MSVC_CMD_BOOTSTRAP = "vcvars64.bat"
$env:BOOST_BOOTSTRAP = "${env:BOOST_ROOT_DIR}\bootstrap.bat"
Expand Down

0 comments on commit 0f7f085

Please sign in to comment.