compat.spdlog
#includeFast C++ logging library (header-only by default, compiled via the `compiled` feature)
#include <spdlog/spdlog.h>
mcpp add compat.spdlog@1.17.0
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// Behavioral test: consume compat.spdlog in COMPILED mode. Asserts both halves
// of what the `compiled` feature promises:
//
// 1. the interface define reached this TU (SPDLOG_COMPILED_LIB defined, and
// spdlog's headers therefore did NOT flip on SPDLOG_HEADER_ONLY) — a
// static check, so a regression is a compile error, not a silent fallback
// to the header-only path that would still pass the runtime assertions;
// 2. spdlog's src/*.cpp really were compiled and linked — the calls below
// resolve to out-of-line symbols (default_logger_raw, log_msg's ctor,
// logger::log_it_, and bundled fmt's vformat), which is exactly what fails
// to link when the engine skips a feature's sources.
#include <spdlog/spdlog.h>
#include <spdlog/sinks/ostream_sink.h>
#include <sstream>
#include <string>
#ifndef SPDLOG_COMPILED_LIB
#error "compiled feature did not propagate SPDLOG_COMPILED_LIB to the consumer"
#endif
#ifdef SPDLOG_HEADER_ONLY
#error "SPDLOG_HEADER_ONLY is on in compiled mode — headers took the inline path"
#endif
// …
tests/examples/spdlog-compiled/tests/compiled_test.cpp · 项目 tests/examples/spdlog-compiled
openkal
| 目标 | 结果 | 环境 | 测试项目 | 首条诊断 |
|---|---|---|---|---|
| x86_64-linux-gnu | runs | posix | spdlog | |
| x86_64-windows-musl | runs | posix | spdlog |
测量方式
2026-09-23 由 tests/openkal/compat.py 测得,使用 openkal-llvm-runtime 0.15.1、llvm@22.1.8、mcpp 2026.9.21.3。测试项目没有自行选择平台依赖。 上方徽章是所有已测目标里最严格那个的结果 —— 上表列出每个目标各自的环境。
构建
- targets
spdlog (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*/include
特性
| 特性 | 声明了 |
|---|---|
| compiled | sources, defines |
源文件 (1)
mcpp_generated/spdlog_anchor.c
生成的文件
mcpp_generated/spdlog_anchor.c
版本
| 版本 | 平台 | 镜像 | sha256 |
|---|---|---|---|
1.17.0 最新 |
LinuxWindowsmacOS | 源站 | d8862955c6d7… |