Otok public index

apotocki/boost

apotocki/boost 1.92.0 (r1, windows-clang-cl)

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

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" }

Toolchains

Recipe files

build.lua 2951 bytes · raw
-- Boost's CMake with clang-cl, its libraries named as b2's --layout=system names them: a program built with MSVC
-- defines BOOST_AUTO_LINK_SYSTEM for auto-linking to ask for these names (or BOOST_ALL_NO_LIB to link them itself),
-- since no toolset tag of b2 (vc145) can be the consumer's. The release archive has every library's CMakeLists.txt and
-- tools/cmake, not the superproject's CMakeLists.txt (cmake/CMakeLists.txt of this recipe) nor libs/*/include: the
-- headers are in boost/ of the root, which every compile is given. The libraries go to the stage directory, the prefix;
-- nothing is installed.

-- stacktrace backends b2 builds only where it finds what they need, 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
        if deps.icu4c then error("ICU for Boost is not built with clang-cl yet") end
        otok.copy(slice.recipe .. "/cmake/CMakeLists.txt", slice.source .. "/CMakeLists.txt")
        otok.cmake{ defines = {
            BOOST_INCLUDE_LIBRARIES = table.concat(selected, ";"),
            BOOST_STAGEDIR = slice.prefix,
            BOOST_SKIP_INSTALL_RULES = true,
            BOOST_INSTALL_LAYOUT = "system",  -- the names of b2's --layout=system, not -clangw21-mt-x64-1_92
            CMAKE_C_STANDARD_INCLUDE_DIRECTORIES = slice.source,
            CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES = slice.source,
            BOOST_LOCALE_ENABLE_ICU = false,
            BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS = true,  -- the C99 and TR1 libraries, which b2 builds
            BUILD_TESTING = false,
            -- Boost.Context assembled by clang-cl, in GNU syntax: its armclang sources for ARM64; for x86_64 its gas
            -- sources, which cmake/CMakeLists.txt turns into clang's (LLVM has no armasm64, and llvm-ml makes absolute
            -- addresses of what ml64 addresses relative to RIP, which MSVC's linker refuses)
            BOOST_CONTEXT_ASSEMBLER = slice.arch == "arm64" and "armclang" or "gas",
            BOOST_CONTEXT_ASM_SUFFIX = slice.arch == "arm64" and ".S" or nil,
        } }
    end
    -- the headers
    otok.copy(slice.source .. "/boost", slice.prefix .. "/include/boost")

    -- boost_json.lib with boost_json.dll, or libboost_json.lib
    local libraries = {}
    for _, file in ipairs(otok.glob("lib/*boost_*.lib", slice.prefix)) do
        local base = file:match("/(l?i?b?boost_[%w_]+)%.lib$")
        if base then
            local dll = otok.glob("bin/" .. base .. ".dll", slice.prefix)[1]
            libraries[base:match("boost_([%w_]+)$")] = 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
cmake/CMakeLists.txt 2571 bytes · raw
# Partly after the superproject's CMakeLists.txt of Boost: Copyright 2019, 2021 Peter Dimov, distributed under the
# Boost Software License, Version 1.0 (https://www.boost.org/LICENSE_1_0.txt).
# SPDX-License-Identifier: BSL-1.0
#
# The superproject's CMakeLists.txt, which the release archive leaves out (tools/cmake/README.md). The recipe builds
# Boost with CMake for the windows target, from the release's own tools/cmake and the CMakeLists.txt of each library.
cmake_minimum_required(VERSION 3.16...3.31)
project(Boost VERSION 1.92.0 LANGUAGES CXX)
set(BOOST_SUPERPROJECT_VERSION ${PROJECT_VERSION})
set(BOOST_SUPERPROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR})
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/tools/cmake/include)
# the headers of boost/ in the root (CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES), for the checks of the libraries too
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_C_STANDARD_INCLUDE_DIRECTORIES CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES)
include(BoostRoot)

# What b2 builds and Boost's CMake leaves to the headers, so that the products are those of every target (b2 builds
# exception for the libraries that depend on it, cobalt, contract and others, whichever are selected):
# libboost_exception, static as b2 makes it, and boost_regex, its POSIX API (regcomp and the like).
add_library(otok_boost_exception STATIC libs/exception/src/clone_current_exception_non_intrusive.cpp)
set_target_properties(otok_boost_exception PROPERTIES OUTPUT_NAME libboost_exception PREFIX "")
add_library(otok_boost_regex libs/regex/src/posix_api.cpp libs/regex/src/wide_posix_api.cpp)
if(BUILD_SHARED_LIBS)
  set_target_properties(otok_boost_regex PROPERTIES OUTPUT_NAME boost_regex)
  target_compile_definitions(otok_boost_regex PRIVATE BOOST_REGEX_DYN_LINK=1)
else()
  set_target_properties(otok_boost_regex PROPERTIES OUTPUT_NAME libboost_regex PREFIX "")
endif()

# Boost.Context for x86_64 with BOOST_CONTEXT_ASSEMBLER gas: GNU syntax in .asm files (MinGW's), which clang-cl does not
# take for assembly; the same in clang's .S (make_x86_64_ms_pe_clang_gas.S)
if(TARGET boost_context)
  get_target_property(otok_context_sources boost_context SOURCES)
  set(otok_context_clang "")
  foreach(source IN LISTS otok_context_sources)
    if(source MATCHES "_x86_64_ms_pe_gas\.asm$")
      string(REGEX REPLACE "_gas\.asm$" "_clang_gas.S" source "${PROJECT_SOURCE_DIR}/libs/context/${source}")
    endif()
    list(APPEND otok_context_clang "${source}")
  endforeach()
  set_property(TARGET boost_context PROPERTY SOURCES ${otok_context_clang})
endif()
recipe.toml 8380 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-clang-cl"
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"

[platforms]
supported = ["windows"]
build-on = ["linux/clang-cl"]

# built with Boost's CMake (build.lua)
[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }

[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" }