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… |