Otok public index

apotocki/boost

apotocki/boost 1.92.0 (r1, windows-msvc)

Library
boost
Variant
windows-msvc, target windows
Channel
stable
Published
2026-11-07
Recipe source
https://github.com/otok-dev/recipes.git
32756a87cf5bd189ca4c9825159bf0713ea8cf5e in recipes/boost/1.92/windows-msvc/
Recipe SHA-256
64833d0ca0b66394cdebae3457296e8e0249ec1d1b09981bf047c8b0c9d5d19e

Recipe files changed

Inputs

source.mirrors["https://sourceforge.net/projects/boost/files/boost/1.92.0/boost_1_92_0.tar.bz2"]
source.sha2565c1d40cb8e19adbf740a4ec2da35b3e58f3f5804b1dce44deb53df72193cbc6c
source.urlhttps://archives.boost.io/release/1.92.0/source/boost_1_92_0.tar.bz2

Platforms

windows

Options

OptionTypeDefaultDescription
icu bool false ICU (the icu4c recipe) as the backend of Boost.Locale and for the Unicode support of Boost.Regex (boost/regex/icu.hpp). The products of Boost then hold ICU's libraries, which a static link takes only as far as it uses them.
librariesadditive list of ["atomic", "charconv", "chrono", "cobalt", "container", "context", "contract", "coroutine", "date_time", "exception", "fiber", "filesystem", "graph", "iostreams", "json", "locale", "log", "math", "nowide", "process", "program_options", "random", "regex", "serialization", "stacktrace", "test", "thread", "timer", "type_erasure", "url", "wave"] [] The compiled libraries to build (b2 --with-<library>); each becomes a product. Without any, Boost is its headers.

Dependencies

LibraryVersionRecipeDetails
icu4c >= 70 apotocki/icu4c when = { option = "icu" }

Recipe files

build.lua 2850 bytes · raw
-- Boost's own b2 build with MSVC. build_tools builds b2 for the build machine once; every slice runs it with the
-- slice's toolchain (otok.b2), for the libraries the project selects. The libraries have the names auto-linking asks
-- for (--layout=versioned, b2's default on Windows).

function build_tools(slice, options, deps)
    -- bootstrap finds the build machine's compiler: by its full path, and with cmd finding the scripts it calls in the
    -- current directory, which NoDefaultCurrentDirectoryInExePath turns off
    local script = (slice.source .. "/bootstrap.bat"):gsub("/", "\\")
    otok.run({ "cmd.exe", "/c", script }, { env = { NoDefaultCurrentDirectoryInExePath = false } })
    otok.copy(slice.source .. "/b2.exe", slice.prefix .. "/bin/b2.exe")
end

-- stacktrace backends b2 builds only where it finds what they need (addr2line on macOS alone), which no
-- product offers: every slice returns the same libraries
local unoffered = { stacktrace_addr2line = true, stacktrace_dump = true, stacktrace_from_exception = true }

function build(slice, options, deps)
    local selected = options.libraries
    if #selected > 0 then
        -- the project's C++ standard, else 20
        local args = { "cxxstd=" .. (slice.cxx_standard or 20) }
        for _, l in ipairs(selected) do args[#args + 1] = "--with-" .. l end
        -- where WinDbg is, b2 builds stacktrace_windbg instead of stacktrace_basic: the product BoostStacktraceBasic
        -- holds it, as Boost's CMake builds it
        args[#args + 1] = "boost.stacktrace.basic=on"
        -- ICU only when asked for: b2 would take any ICU it finds (has_icu), so it is turned off otherwise
        if deps.icu4c then
            args[#args + 1] = "-sICU_PATH=" .. deps.icu4c.prefix
            args[#args + 1] = "boost.locale.icu=on"
        else
            args[#args + 1] = "boost.locale.icu=off"
            args[#args + 1] = "--disable-icu"
        end
        otok.b2{ b2 = slice.tools.prefix .. "/bin/b2", args = args, targets = { "stage" }, env = { NoDefaultCurrentDirectoryInExePath = false } }
    end
    -- the headers, without b2 install copying 16000 files one by one
    otok.copy(slice.source .. "/boost", slice.prefix .. "/include/boost")

    -- the names auto-linking asks for: libboost_json-vc145-mt-x64-1_92.lib, boost_json-vc145-mt-x64-1_92.lib with its
    -- DLL
    local libraries = {}
    for _, file in ipairs(otok.glob("lib/*.lib", slice.prefix)) do
        local name = file:match("/l?i?b?boost_([%w_]+)%-vc[^/]*%.lib$")
        if name then
            local dll = file:gsub("%.lib$", ".dll")
            libraries[name] = otok.exists(dll) and { link = file, runtime = dll } or file
        end
    end
    for name in pairs(unoffered) do libraries[name] = nil end
    return { libraries = libraries, headers = slice.prefix .. "/include" }
end
patches/0003-msvc-rc-includes.patch 1074 bytes · raw
The resource scripts of the msvc toolset get only the include paths in the build directory. mc writes Boost.Log's
simple_event_log.rc there with what it includes; the include paths of every library of the modular tree (45 of them for
Boost.Log) made rc's command longer than cmd takes (8191) when the tree is under a long path, such as a cache directory.

diff --git a/tools/build/src/tools/msvc.jam b/tools/build/src/tools/msvc.jam
index 5638aab..ad66008 100644
--- a/tools/build/src/tools/msvc.jam
+++ b/tools/build/src/tools/msvc.jam
@@ -881,6 +881,10 @@ actions compile.mc
 rule compile.rc ( targets + : sources * : properties * )
 {
     set-setup-command $(targets) : $(properties) ;
+    # the scripts mc writes (Boost.Log) include only what it writes into the build directory: the include paths
+    # of every library of the modular tree made the command longer than cmd takes (8191) under a long path
+    local includes = [ on $(targets[1]) return $(INCLUDES) ] ;
+    INCLUDES on $(targets) = [ MATCH "^(.*bin\.v2.*)$" : $(includes) ] ;
 }
 
 actions compile.rc
patches/0004-serialization-codecvt-null-once.patch 648 bytes · raw
Boost.Serialization's Jamfile builds codecvt_null.cpp into both serialization and wserialization, which links
serialization: two archives defining codecvt_null<wchar_t>, an overlap in one image (otok-toml.md 4.5). Boost's CMake
builds it into serialization alone; so does b2 with this.

diff --git a/libs/serialization/build/Jamfile.v2 b/libs/serialization/build/Jamfile.v2
index 50fcce7..80cbb53 100644
--- a/libs/serialization/build/Jamfile.v2
+++ b/libs/serialization/build/Jamfile.v2
@@ -117,7 +117,6 @@ WSOURCES =
     xml_woarchive
     polymorphic_xml_wiarchive
     polymorphic_xml_woarchive
-    codecvt_null
 ;
 
 lib boost_serialization
recipe.toml 8440 bytes · raw
# The otok recipe of Boost (docs/PLAN.md decision 36): the headers as one product, the compiled
# libraries the project selects as products of their own (recipe-toml.md 11.1).
[recipe]
api = 1
library = "boost"
name = "boost"
version = "1.92.0"
revision = 1
variant = "windows-msvc"
license = "BSL-1.0"
license-files = ["LICENSE_1_0.txt"]
homepage = "https://www.boost.org"
documentation = "https://www.boost.org/doc/libs/1_92_0/"
description = "Boost C++ libraries: the headers, and the compiled libraries a project selects."
keywords = ["boost", "cpp"]
linkage = ["static", "dynamic"]
cxx-standard = ">= 11"

[source]
url = "https://archives.boost.io/release/1.92.0/source/boost_1_92_0.tar.bz2"
mirrors = ["https://sourceforge.net/projects/boost/files/boost/1.92.0/boost_1_92_0.tar.bz2"]
sha256 = "5c1d40cb8e19adbf740a4ec2da35b3e58f3f5804b1dce44deb53df72193cbc6c"
# the resource scripts of MSVC with only the include paths of the build directory; codecvt_null in serialization alone,
# as Boost's CMake builds it
patches = ["patches/0003-msvc-rc-includes.patch", "patches/0004-serialization-codecvt-null-once.patch"]

[platforms]
supported = ["windows"]
build-on = ["windows/msvc"]

[options.libraries]
type = "list"
values = ["atomic", "charconv", "chrono", "cobalt", "container", "context", "contract", "coroutine", "date_time", "exception", "fiber", "filesystem", "graph", "iostreams", "json", "locale", "log", "math", "nowide", "process", "program_options", "random", "regex", "serialization", "stacktrace", "test", "thread", "timer", "type_erasure", "url", "wave"]
default = []
additive = true
doc = "The compiled libraries to build (b2 --with-<library>); each becomes a product. Without any, Boost is its headers."

[options.icu]
type = "bool"
default = false
doc = "ICU (the icu4c recipe) as the backend of Boost.Locale and for the Unicode support of Boost.Regex (boost/regex/icu.hpp). The products of Boost then hold ICU's libraries, which a static link takes only as far as it uses them."

[deps.icu4c]
version = ">= 70"
default-recipe = "apotocki/icu4c"
when = { option = "icu" }

[[product]]
name = "Boost"
libraries = []
link = { runtime = "c++" }

[[product]]
name = "BoostAtomic"
libraries = ["atomic"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "atomic" }

[[product]]
name = "BoostCharconv"
libraries = ["charconv"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "charconv" }

[[product]]
name = "BoostChrono"
libraries = ["chrono"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "chrono" }

[[product]]
name = "BoostCobalt"
libraries = ["cobalt", "cobalt_io", "container", "context", "date_time", "exception"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "cobalt" }

[[product]]
name = "BoostContainer"
libraries = ["container"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "container" }

[[product]]
name = "BoostContext"
libraries = ["context"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "context" }

[[product]]
name = "BoostContract"
libraries = ["contract", "atomic", "chrono", "container", "date_time", "exception", "thread"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "contract" }

[[product]]
name = "BoostCoroutine"
libraries = ["coroutine", "context", "exception"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "coroutine" }

[[product]]
name = "BoostDateTime"
libraries = ["date_time", "container", "exception"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "date_time" }

[[product]]
name = "BoostException"
libraries = ["exception"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "exception" }

[[product]]
name = "BoostFiber"
libraries = ["fiber", "context", "exception", "filesystem"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "fiber" }

[[product]]
name = "BoostFilesystem"
libraries = ["filesystem"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "filesystem" }

[[product]]
name = "BoostGraph"
libraries = ["graph", "atomic", "chrono", "container", "date_time", "exception", "math_c99", "math_c99f", "math_c99l", "math_tr1", "math_tr1f", "math_tr1l", "random", "serialization", "thread", "wserialization"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "graph" }

[[product]]
name = "BoostIostreams"
libraries = ["iostreams", "random"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "iostreams" }

[[product]]
name = "BoostJson"
libraries = ["json", "container"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "json" }

[[product]]
name = "BoostLocale"
libraries = ["locale", "atomic", "charconv", "chrono", "container", "date_time", "exception", "thread"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "locale" }

[[product]]
name = "BoostLog"
libraries = ["log", "log_setup", "atomic", "chrono", "container", "date_time", "exception", "filesystem", "serialization", "thread", "wserialization"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "log" }

[[product]]
name = "BoostMath"
libraries = ["math_c99", "math_c99f", "math_c99l", "math_tr1", "math_tr1f", "math_tr1l", "container", "random"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "math" }

[[product]]
name = "BoostNowide"
libraries = ["nowide"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "nowide" }

[[product]]
name = "BoostProcess"
libraries = ["process", "container", "context", "date_time", "exception", "filesystem"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "process" }

[[product]]
name = "BoostProgramOptions"
libraries = ["program_options", "container"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "program_options" }

[[product]]
name = "BoostRandom"
libraries = ["random"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "random" }

[[product]]
name = "BoostRegex"
libraries = ["regex"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "regex" }

[[product]]
name = "BoostSerialization"
libraries = ["serialization", "wserialization", "atomic", "chrono", "container", "date_time", "exception", "thread"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "serialization" }

[[product]]
name = "BoostStacktraceBasic"
libraries = ["stacktrace_basic"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "stacktrace" }
alternatives = "stacktrace"

[[product]]
name = "BoostStacktraceNoop"
libraries = ["stacktrace_noop"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "stacktrace" }
alternatives = "stacktrace"

[[product]]
name = "BoostUnitTestFramework"
libraries = ["unit_test_framework", "exception"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "test" }
alternatives = "test"

[[product]]
name = "BoostPrgExecMonitor"
libraries = ["prg_exec_monitor"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "test" }
alternatives = "test"

[[product]]
name = "BoostTestExecMonitor"
libraries = ["test_exec_monitor", "exception"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "test" }
alternatives = "test"

[[product]]
name = "BoostThread"
libraries = ["thread", "atomic", "chrono", "container", "date_time", "exception"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "thread" }

[[product]]
name = "BoostTimer"
libraries = ["timer"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "timer" }

[[product]]
name = "BoostTypeErasure"
libraries = ["type_erasure", "atomic", "chrono", "container", "date_time", "exception", "thread"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "type_erasure" }

[[product]]
name = "BoostUrl"
libraries = ["url"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "url" }

[[product]]
name = "BoostWave"
libraries = ["wave", "atomic", "chrono", "container", "date_time", "exception", "filesystem", "serialization", "thread", "wserialization"]
headers = false
depends = ["Boost"]
when = { option = "libraries", has = "wave" }