mcpp index

compat.spdlog

#include

Fast 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

建置

targets
spdlog (lib)
language
c++23
C standard
c11
import std
no
include dirs
*/include

功能

功能宣告了
compileddefines, sources

原始檔 (1)

  • mcpp_generated/spdlog_anchor.c

產生的檔案

  • mcpp_generated/spdlog_anchor.c

版本

版本平台 鏡像sha256
1.17.0 最新 LinuxWindowsmacOS 來源 d8862955c6d7…