-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcompat.boost-asio.lua
More file actions
114 lines (112 loc) · 5.64 KB
/
Copy pathcompat.boost-asio.lua
File metadata and controls
114 lines (112 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
-- Form B inline descriptor for Boost.Asio 1.92.0 — networking/async I/O as
-- consumed INSIDE the modular-boost header family. This is the boostorg/asio
-- tree (Boost.Asio), NOT the standalone chriskohlhoff.asio package already in
-- this index: Beast 1.92 removed BEAST_USE_STANDALONE_ASIO upstream, so the
-- beast descriptor has no choice but to ride boost.asio (see compat.boost-beast).
--
-- Header-only — the boostorg superproject builds no compiled asio target.
-- Part of the modular-boost header family; see compat.boost-config for the
-- family wiring and version-train policy. Header closure verified by grepping
-- every `<boost/...>` include across the include tree and cross-checked
-- against the repo's CMakeLists INTERFACE line:
-- asio -> align, assert, config, system, throw_exception
-- (+ context, date_time — both DISABLED, see below)
-- Boost.Align looks surprising on first read but is real: asio/detail/memory
-- routes aligned allocations through boost::align::align.
--
-- Two optional Boost libraries are compile-time auto-detected and deliberately
-- switched OFF via the package's default feature (same trick as the
-- standalone chriskohlhoff.asio's ASIO_DISABLE_BOOST_CONTEXT_FIBER):
--
-- * boost.context — spawn()/yield_context stackful coroutines. The fiber
-- detection is compiler-only (clang/gcc >= C++11 ⇒ on), so without the
-- disable define asio/impl/spawn.hpp would #include <boost/context/fiber.hpp>,
-- and Boost.Context is a COMPILED (and assembly) library — packaging it
-- would end this family's header-only property. Beast never calls spawn.
-- * boost.date_time — the legacy deadline_timer. asio/deadline_timer.hpp and
-- time_traits.hpp are guarded by BOOST_ASIO_HAS_BOOST_DATE_TIME, so with
-- the disable define even `#include <boost/asio.hpp>` never reaches
-- boost/date_time. Beast uses steady_timer (std::chrono).
--
-- With both off, the asio surface is the same one the standalone package
-- exposes minus iostream/streambuf quirks: io_context, timers, sockets,
-- buffers, co_spawn/awaitable, ssl (headers — requires an OpenSSL dep the
-- consumer must bring, e.g. compat.openssl; NOT wired here). Handlers run on
-- POSIX threads auto-detected via unistd.h macros; no ldflags needed beyond
-- what the consumer's own profile carries — see chriskohlhoff.asio for the
-- -pthread precedent if a member ever needs it pinned.
--
-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0.
package = {
spec = "1",
namespace = "compat",
name = "boost-asio",
description = "Boost.Asio 1.92.0 — networking/async I/O; the boostorg tree consumed by Boost.Beast",
licenses = {"BSL-1.0"},
repo = "https://github.com/boostorg/asio",
type = "package",
xpm = {
linux = {
["1.92.0"] = {
url = "https://github.com/boostorg/asio/archive/refs/tags/boost-1.92.0.tar.gz",
sha256 = "9aff35259a81bc08cf7a4498cec06e8e35a645a54b917ae16c3e5884fd260ecb",
},
},
macosx = {
["1.92.0"] = {
url = "https://github.com/boostorg/asio/archive/refs/tags/boost-1.92.0.tar.gz",
sha256 = "9aff35259a81bc08cf7a4498cec06e8e35a645a54b917ae16c3e5884fd260ecb",
},
},
windows = {
["1.92.0"] = {
url = "https://github.com/boostorg/asio/archive/refs/tags/boost-1.92.0.tar.gz",
sha256 = "9aff35259a81bc08cf7a4498cec06e8e35a645a54b917ae16c3e5884fd260ecb",
},
},
},
mcpp = {
language = "c++20",
import_std = false,
-- Exposes `boost/asio/` (+ boost/asio.hpp) so family consumers'
-- `#include <boost/asio/buffer.hpp>` resolve.
include_dirs = { "*/include" },
-- Header-only: a trivial anchor TU gives mcpp a buildable lib target.
generated_files = {
["mcpp_generated/boost_asio_anchor.cpp"] = [==[
int mcpp_compat_boost_asio_anchor(void) { return 0; }
]==],
},
sources = { "mcpp_generated/boost_asio_anchor.cpp" },
targets = { ["boost_asio"] = { kind = "lib" } },
-- The disable defines ride the package's default feature so they reach
-- every TU that compiles an asio header — direct consumers here, and
-- compat.boost-beast consumers through its own identical default
-- feature (idempotent, same values — see that descriptor).
--
-- BOOST_ASIO_HAS_THREADS is pinned for the same reason
-- chriskohlhoff.asio pins ASIO_HAS_THREADS: the workspace's
-- llvm-on-Windows toolchain (clang → x86_64-pc-windows-msvc) defines
-- no _MT/_REENTRANT and boost::config yields no BOOST_HAS_THREADS, so
-- asio's own detection (detail/config.hpp) silently selects
-- null_thread. It also feeds BOOST_ASIO_VERSION_TAG, so it must agree
-- across every TU — hence a feature define, not a cflag.
features = {
["default"] = { implies = { "asio-config" } },
["asio-config"] = {
defines = {
"BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER",
"BOOST_ASIO_DISABLE_BOOST_DATE_TIME",
"BOOST_ASIO_HAS_THREADS",
},
},
},
deps = {
["compat.boost-align"] = "1.92.0",
["compat.boost-assert"] = "1.92.0",
["compat.boost-config"] = "1.92.0",
["compat.boost-system"] = "1.92.0",
["compat.boost-throw-exception"] = "1.92.0",
},
},
}