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

Usage

From this repository's own test project — built and run by CI, not written for the website.

// 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 · project tests/examples/spdlog-compiled

Build

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

Features

featuredeclares
compileddefines, sources

Sources (1)

  • mcpp_generated/spdlog_anchor.c

Generated files

  • mcpp_generated/spdlog_anchor.c

Versions

VersionPlatforms Mirrorssha256
1.17.0 latest LinuxWindowsmacOS source d8862955c6d7…