mirror of
https://github.com/gabime/spdlog.git
synced 2025-04-28 03:33:51 +00:00
Compare commits
10 Commits
3f30000088
...
408a2229d6
Author | SHA1 | Date | |
---|---|---|---|
|
408a2229d6 | ||
|
7cdd65075c | ||
|
436ce16e79 | ||
|
58320e2678 | ||
|
a6f7edf94b | ||
|
4a4f13be46 | ||
|
a13b0abb7d | ||
|
c081919320 | ||
|
21f7f78130 | ||
|
bb1b24c178 |
@ -14,9 +14,9 @@
|
|||||||
// This is because each message in the queue holds a shared_ptr to the
|
// This is because each message in the queue holds a shared_ptr to the
|
||||||
// originating logger.
|
// originating logger.
|
||||||
|
|
||||||
#include "spdlog/async_logger.h"
|
#include <spdlog/async_logger.h>
|
||||||
#include "spdlog/details/registry.h"
|
#include <spdlog/details/registry.h>
|
||||||
#include "spdlog/details/thread_pool.h"
|
#include <spdlog/details/thread_pool.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/async_logger.h"
|
#include <spdlog/async_logger.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/sinks/sink.h"
|
#include <spdlog/sinks/sink.h>
|
||||||
#include "spdlog/details/thread_pool.h"
|
#include <spdlog/details/thread_pool.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// Upon destruction, logs all remaining messages in the queue before
|
// Upon destruction, logs all remaining messages in the queue before
|
||||||
// destructing..
|
// destructing..
|
||||||
|
|
||||||
#include "spdlog/logger.h"
|
#include <spdlog/logger.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/tweakme.h"
|
#include <spdlog/tweakme.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
#define SPDLOG_INLINE inline
|
#define SPDLOG_INLINE inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/fmt/fmt.h"
|
#include <spdlog/fmt/fmt.h>
|
||||||
|
|
||||||
// visual studio upto 2013 does not support noexcept nor constexpr
|
// visual studio upto 2013 does not support noexcept nor constexpr
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1900)
|
#if defined(_MSC_VER) && (_MSC_VER < 1900)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/backtracer.h"
|
#include <spdlog/details/backtracer.h>
|
||||||
#endif
|
#endif
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/log_msg_buffer.h"
|
#include <spdlog/details/log_msg_buffer.h>
|
||||||
#include "spdlog/details/circular_q.h"
|
#include <spdlog/details/circular_q.h>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/file_helper.h"
|
#include <spdlog/details/file_helper.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include "spdlog/fmt/fmt.h"
|
#include <spdlog/fmt/fmt.h>
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
// Some fmt helpers to efficiently format and pad ints and strings
|
// Some fmt helpers to efficiently format and pad ints and strings
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/log_msg_buffer.h"
|
#include <spdlog/details/log_msg_buffer.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
// dequeue_for(..) - will block until the queue is not empty or timeout have
|
// dequeue_for(..) - will block until the queue is not empty or timeout have
|
||||||
// passed.
|
// passed.
|
||||||
|
|
||||||
#include "spdlog/details/circular_q.h"
|
#include <spdlog/details/circular_q.h>
|
||||||
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include <ctime> // std::time_t
|
#include <ctime> // std::time_t
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/details/fmt_helper.h"
|
#include <spdlog/details/fmt_helper.h>
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
#include "spdlog/fmt/fmt.h"
|
#include <spdlog/fmt/fmt.h>
|
||||||
#include "spdlog/formatter.h"
|
#include <spdlog/formatter.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
#include "spdlog/formatter.h"
|
#include <spdlog/formatter.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/periodic_worker.h"
|
#include <spdlog/details/periodic_worker.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -4,20 +4,20 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/registry.h"
|
#include <spdlog/details/registry.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/periodic_worker.h"
|
#include <spdlog/details/periodic_worker.h>
|
||||||
#include "spdlog/logger.h"
|
#include <spdlog/logger.h>
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
|
|
||||||
#ifndef SPDLOG_DISABLE_DEFAULT_LOGGER
|
#ifndef SPDLOG_DISABLE_DEFAULT_LOGGER
|
||||||
// support for the default stdout color logger
|
// support for the default stdout color logger
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "spdlog/sinks/wincolor_sink.h"
|
#include <spdlog/sinks/wincolor_sink.h>
|
||||||
#else
|
#else
|
||||||
#include "spdlog/sinks/ansicolor_sink.h"
|
#include <spdlog/sinks/ansicolor_sink.h>
|
||||||
#endif
|
#endif
|
||||||
#endif // SPDLOG_DISABLE_DEFAULT_LOGGER
|
#endif // SPDLOG_DISABLE_DEFAULT_LOGGER
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// If user requests a non existing logger, nullptr will be returned
|
// If user requests a non existing logger, nullptr will be returned
|
||||||
// This class is thread safe
|
// This class is thread safe
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/details/thread_pool.h"
|
#include <spdlog/details/thread_pool.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace details {
|
namespace details {
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/log_msg_buffer.h"
|
#include <spdlog/details/log_msg_buffer.h>
|
||||||
#include "spdlog/details/mpmc_blocking_q.h"
|
#include <spdlog/details/mpmc_blocking_q.h>
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -27,7 +27,7 @@ enum class async_msg_type
|
|||||||
terminate
|
terminate
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "spdlog/details/log_msg_buffer.h"
|
#include <spdlog/details/log_msg_buffer.h>
|
||||||
// Async msg to move to/from the queue
|
// Async msg to move to/from the queue
|
||||||
// Movable only. should never be copied
|
// Movable only. should never be copied
|
||||||
struct async_msg : log_msg_buffer
|
struct async_msg : log_msg_buffer
|
||||||
|
@ -22,6 +22,6 @@
|
|||||||
#include "bundled/core.h"
|
#include "bundled/core.h"
|
||||||
#include "bundled/format.h"
|
#include "bundled/format.h"
|
||||||
#else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib
|
#else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib
|
||||||
#include "fmt/core.h"
|
#include <fmt/core.h>
|
||||||
#include "fmt/format.h"
|
#include <fmt/format.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "fmt/fmt.h"
|
#include <spdlog/fmt/fmt.h>
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/logger.h"
|
#include <spdlog/logger.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/sinks/sink.h"
|
#include <spdlog/sinks/sink.h>
|
||||||
#include "spdlog/details/backtracer.h"
|
#include <spdlog/details/backtracer.h>
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@
|
|||||||
// The use of private formatter per sink provides the opportunity to cache some
|
// The use of private formatter per sink provides the opportunity to cache some
|
||||||
// formatted data, and support for different format per sink.
|
// formatted data, and support for different format per sink.
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
#include "spdlog/details/backtracer.h"
|
#include <spdlog/details/backtracer.h>
|
||||||
|
|
||||||
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
|
|
||||||
#include "spdlog/details/fmt_helper.h"
|
#include <spdlog/details/fmt_helper.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
|
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/sinks/ansicolor_sink.h"
|
#include <spdlog/sinks/ansicolor_sink.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/console_globals.h"
|
#include <spdlog/details/console_globals.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/sinks/sink.h"
|
#include <spdlog/sinks/sink.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
// implementers..
|
// implementers..
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
#include "spdlog/sinks/sink.h"
|
#include <spdlog/sinks/sink.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/sinks/basic_file_sink.h"
|
#include <spdlog/sinks/basic_file_sink.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/file_helper.h"
|
#include <spdlog/details/file_helper.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/file_helper.h"
|
#include <spdlog/details/file_helper.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/fmt/fmt.h"
|
#include <spdlog/fmt/fmt.h>
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
#include "spdlog/details/os.h"
|
#include <spdlog/details/os.h>
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base_sink.h"
|
#include "base_sink.h"
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "dist_sink.h"
|
#include "dist_sink.h"
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
//
|
//
|
||||||
// Example:
|
// Example:
|
||||||
//
|
//
|
||||||
// #include "spdlog/sinks/dup_filter_sink.h"
|
// #include <spdlog/sinks/dup_filter_sink.h>
|
||||||
//
|
//
|
||||||
// int main() {
|
// int main() {
|
||||||
// auto dup_filter = std::make_shared<dup_filter_sink_st>(std::chrono::seconds(5));
|
// auto dup_filter = std::make_shared<dup_filter_sink_st>(std::chrono::seconds(5));
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
|
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/sinks/rotating_file_sink.h"
|
#include <spdlog/sinks/rotating_file_sink.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
#include "spdlog/details/file_helper.h"
|
#include <spdlog/details/file_helper.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/fmt/fmt.h"
|
#include <spdlog/fmt/fmt.h>
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
#include "spdlog/details/file_helper.h"
|
#include <spdlog/details/file_helper.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/sinks/sink.h"
|
#include <spdlog/sinks/sink.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const
|
SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/log_msg.h"
|
#include <spdlog/details/log_msg.h>
|
||||||
#include "spdlog/formatter.h"
|
#include <spdlog/formatter.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
#include <spdlog/sinks/stdout_color_sinks.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/logger.h"
|
#include <spdlog/logger.h>
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "spdlog/sinks/wincolor_sink.h"
|
#include <spdlog/sinks/wincolor_sink.h>
|
||||||
#else
|
#else
|
||||||
#include "spdlog/sinks/ansicolor_sink.h"
|
#include <spdlog/sinks/ansicolor_sink.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/sinks/stdout_sinks.h"
|
#include <spdlog/sinks/stdout_sinks.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/details/console_globals.h"
|
#include <spdlog/details/console_globals.h>
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/details/console_globals.h"
|
#include <spdlog/details/console_globals.h>
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
#include "spdlog/sinks/sink.h"
|
#include <spdlog/sinks/sink.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/sinks/base_sink.h"
|
#include <spdlog/sinks/base_sink.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#ifndef SD_JOURNAL_SUPPRESS_LOCATION
|
#ifndef SD_JOURNAL_SUPPRESS_LOCATION
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/sinks/wincolor_sink.h"
|
#include <spdlog/sinks/wincolor_sink.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/console_globals.h"
|
#include <spdlog/details/console_globals.h>
|
||||||
#include "spdlog/details/null_mutex.h"
|
#include <spdlog/details/null_mutex.h>
|
||||||
#include "spdlog/sinks/sink.h"
|
#include <spdlog/sinks/sink.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef SPDLOG_HEADER_ONLY
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
#include "spdlog/spdlog.h"
|
#include <spdlog/spdlog.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/pattern_formatter.h"
|
#include <spdlog/details/pattern_formatter.h>
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "spdlog/common.h"
|
#include <spdlog/common.h>
|
||||||
#include "spdlog/details/registry.h"
|
#include <spdlog/details/registry.h>
|
||||||
#include "spdlog/logger.h"
|
#include <spdlog/logger.h>
|
||||||
#include "spdlog/version.h"
|
#include <spdlog/version.h>
|
||||||
#include "spdlog/details/synchronous_factory.h"
|
#include <spdlog/details/synchronous_factory.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
109
meson.build
109
meson.build
@ -1,12 +1,12 @@
|
|||||||
project('spdlog', ['cpp'],
|
project('spdlog', ['cpp'],
|
||||||
license : 'MIT',
|
license : 'MIT',
|
||||||
version : run_command(find_program('scripts/extract_version.py')).stdout().strip(),
|
version : run_command(find_program('scripts/extract_version.py')).stdout().strip(),
|
||||||
default_options : [
|
default_options : [
|
||||||
'warning_level=3',
|
'warning_level=3',
|
||||||
'cpp_std=c++11',
|
'cpp_std=c++11',
|
||||||
'buildtype=release',
|
'buildtype=release',
|
||||||
'b_colorout=always',
|
'b_colorout=always',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
# ------------------------
|
# ------------------------
|
||||||
@ -20,17 +20,57 @@ dep_list += dependency('threads')
|
|||||||
|
|
||||||
# Check for FMT
|
# Check for FMT
|
||||||
if get_option('external_fmt')
|
if get_option('external_fmt')
|
||||||
if not meson.version().version_compare('>=0.49.0')
|
if not meson.version().version_compare('>=0.49.0')
|
||||||
warning('Finding fmt can fail with meson versions before 0.49.0')
|
warning('Finding fmt can fail with meson versions before 0.49.0')
|
||||||
endif
|
endif
|
||||||
dep_list += dependency('fmt')
|
dep_list += dependency('fmt')
|
||||||
compile_args += '-DSPDLOG_FMT_EXTERNAL'
|
compile_args += '-DSPDLOG_FMT_EXTERNAL'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('no_exceptions')
|
if get_option('no_exceptions')
|
||||||
compile_args += '-DSPDLOG_NO_EXCEPTIONS'
|
compile_args += '-DSPDLOG_NO_EXCEPTIONS'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if get_option('wchar_support')
|
||||||
|
if build_machine.system() != 'windows'
|
||||||
|
error('wchar_support only supported under windows')
|
||||||
|
endif
|
||||||
|
compile_args += '-DSPDLOG_WCHAR_TO_UTF8_SUPPORT'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('wchar_filenames')
|
||||||
|
if build_machine.system() != 'windows'
|
||||||
|
error('wchar_filenames only supported under windows')
|
||||||
|
endif
|
||||||
|
compile_args += '-DSPDLOG_WCHAR_FILENAMES'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('clock_coarse')
|
||||||
|
if build_machine.system() != 'linux'
|
||||||
|
error('clock_coarse only supported under linux')
|
||||||
|
endif
|
||||||
|
compile_args += '-DSPDLOG_CLOCK_COARSE'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('prevent_child_fd')
|
||||||
|
compile_args += '-DSPDLOG_PREVENT_CHILD_FD'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('no_thread_id')
|
||||||
|
compile_args += '-DSPDLOG_NO_THREAD_ID'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('no_tls')
|
||||||
|
compile_args += '-DSPDLOG_NO_TLS'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get_option('no_atomic_levels')
|
||||||
|
compile_args += '-DSPDLOG_NO_ATOMIC_LEVELS'
|
||||||
|
endif
|
||||||
|
|
||||||
|
compile_args_compiled = compile_args + ['-DSPDLOG_COMPILED_LIB']
|
||||||
|
compile_args_ho = compile_args
|
||||||
|
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
# --- Compiled library version ---
|
# --- Compiled library version ---
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
@ -41,47 +81,49 @@ spdlog_srcs = files([
|
|||||||
'src/async.cpp',
|
'src/async.cpp',
|
||||||
'src/color_sinks.cpp',
|
'src/color_sinks.cpp',
|
||||||
'src/file_sinks.cpp',
|
'src/file_sinks.cpp',
|
||||||
'src/fmt.cpp',
|
|
||||||
'src/spdlog.cpp',
|
'src/spdlog.cpp',
|
||||||
'src/stdout_sinks.cpp'
|
'src/stdout_sinks.cpp'
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if not get_option('external_fmt')
|
||||||
|
spdlog_srcs+= 'src/fmt.cpp'
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('library_type') == 'static'
|
if get_option('library_type') == 'static'
|
||||||
spdlog = static_library(
|
spdlog = static_library(
|
||||||
'spdlog',
|
'spdlog',
|
||||||
spdlog_srcs,
|
spdlog_srcs,
|
||||||
cpp_args : [compile_args] + ['-DSPDLOG_COMPILED_LIB'],
|
cpp_args : compile_args_compiled,
|
||||||
include_directories : spdlog_inc,
|
include_directories : spdlog_inc,
|
||||||
dependencies : dep_list,
|
dependencies : dep_list,
|
||||||
install : not meson.is_subproject()
|
install : not meson.is_subproject()
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
spdlog = shared_library('spdlog',
|
spdlog = shared_library('spdlog',
|
||||||
spdlog_srcs,
|
spdlog_srcs,
|
||||||
cpp_args : [compile_args] + ['-DSPDLOG_COMPILED_LIB'],
|
cpp_args : compile_args_compiled,
|
||||||
include_directories : spdlog_inc,
|
include_directories : spdlog_inc,
|
||||||
dependencies : dep_list,
|
dependencies : dep_list,
|
||||||
install : not meson.is_subproject(),
|
install : not meson.is_subproject(),
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
spdlog_dep = declare_dependency(
|
spdlog_dep = declare_dependency(
|
||||||
link_with : spdlog,
|
link_with : spdlog,
|
||||||
include_directories : spdlog_inc,
|
include_directories : spdlog_inc,
|
||||||
compile_args : compile_args + ['-DSPDLOG_COMPILED_LIB'],
|
compile_args : compile_args_compiled,
|
||||||
dependencies : dep_list,
|
dependencies : dep_list,
|
||||||
version : meson.project_version(),
|
version : meson.project_version(),
|
||||||
)
|
)
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
# --- Header only dependency ---
|
# --- Header only dependency ---
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
|
|
||||||
spdlog_headeronly_dep = declare_dependency(
|
spdlog_headeronly_dep = declare_dependency(
|
||||||
include_directories : spdlog_inc,
|
include_directories : spdlog_inc,
|
||||||
compile_args : compile_args,
|
compile_args : compile_args_ho,
|
||||||
dependencies : dep_list,
|
dependencies : dep_list,
|
||||||
version : meson.project_version(),
|
version : meson.project_version(),
|
||||||
)
|
)
|
||||||
|
|
||||||
# ------------------------
|
# ------------------------
|
||||||
@ -90,31 +132,31 @@ spdlog_headeronly_dep = declare_dependency(
|
|||||||
|
|
||||||
# Do not install when spdlog is used as a subproject
|
# Do not install when spdlog is used as a subproject
|
||||||
if not meson.is_subproject()
|
if not meson.is_subproject()
|
||||||
install_subdir('include/spdlog', install_dir: get_option('includedir'))
|
install_subdir('include/spdlog', install_dir: get_option('includedir'))
|
||||||
|
|
||||||
pkg = import('pkgconfig')
|
pkg = import('pkgconfig')
|
||||||
pkg.generate(spdlog,
|
pkg.generate(spdlog,
|
||||||
name : 'spdlog',
|
name : 'spdlog',
|
||||||
description : 'Fast C++ logging library',
|
description : 'Fast C++ logging library',
|
||||||
url : 'https://github.com/gabime/spdlog',
|
url : 'https://github.com/gabime/spdlog',
|
||||||
extra_cflags : ['-DSPDLOG_COMPILED_LIB']
|
extra_cflags : compile_args_compiled
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
# --- Conditionally add subdirs ---
|
# --- Conditionally add subdirs ---
|
||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
|
|
||||||
if get_option('enable_tests')
|
if get_option('enable_tests') or get_option('enable_tests-ho')
|
||||||
subdir('tests')
|
subdir('tests')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('enable_examples')
|
if get_option('enable_examples')
|
||||||
subdir('example')
|
subdir('example')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('enable_benchmarks')
|
if get_option('enable_benchmarks')
|
||||||
subdir('bench')
|
subdir('bench')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# -------------------
|
# -------------------
|
||||||
@ -122,7 +164,6 @@ endif
|
|||||||
# -------------------
|
# -------------------
|
||||||
|
|
||||||
summary_str = '''spdlog build summary:
|
summary_str = '''spdlog build summary:
|
||||||
|
|
||||||
- using external fmt: @0@
|
- using external fmt: @0@
|
||||||
- building tests: @1@
|
- building tests: @1@
|
||||||
- building examples: @2@
|
- building examples: @2@
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
option('external_fmt', type: 'boolean', value: false, description: 'Use external fmt package instead of the bundled')
|
option('external_fmt', type: 'boolean', value: false, description: 'Use external fmt package instead of the bundled')
|
||||||
option('enable_examples', type: 'boolean', value: true, description: 'Build examples')
|
option('enable_examples', type: 'boolean', value: true, description: 'Build examples')
|
||||||
option('enable_benchmarks', type: 'boolean', value: false, description: 'Build benchmarks')
|
option('enable_benchmarks', type: 'boolean', value: false, description: 'Build benchmarks')
|
||||||
option('enable_tests', type: 'boolean', value: false, description: 'Build tests')
|
option('enable_tests', type: 'boolean', value: true, description: 'Build tests')
|
||||||
|
option('enable_tests_ho', type: 'boolean', value: false, description: 'Build header-only tests')
|
||||||
option('library_type', type: 'combo', choices: ['static', 'shared'], value: 'static', description: 'Library build type')
|
option('library_type', type: 'combo', choices: ['static', 'shared'], value: 'static', description: 'Library build type')
|
||||||
option('no_exceptions', type: 'boolean', value: false, description: 'Disabled exceptions - abort() instead any error')
|
option('no_exceptions', type: 'boolean', value: false, description: 'Disabled exceptions - abort() instead any error')
|
||||||
|
|
||||||
|
option('wchar_support', type: 'boolean', value: false, description:'(Windows only) Support wchar api')
|
||||||
|
option('wchar_filenames', type: 'boolean', value: false, description: '(Windows only) Support wchar filenames')
|
||||||
|
option('clock_coarse', type: 'boolean', value: false, description: '(Linux only) Use the much faster (but much less accurate) CLOCK_REALTIME_COARSE instead of the regular clock')
|
||||||
|
option('prevent_child_fd', type: 'boolean', value: false, description: 'Prevent from child processes to inherit log file descriptors')
|
||||||
|
option('no_thread_id', type: 'boolean', value: false, description: 'prevent spdlog from querying the thread id on each log call if thread id is not needed')
|
||||||
|
option('no_tls', type: 'boolean', value: false, description: 'prevent spdlog from using thread local storage')
|
||||||
|
option('no_atomic_levels', type: 'boolean', value: false, description: 'prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently')
|
||||||
|
@ -14,14 +14,11 @@ set(SPDLOG_UTESTS_SOURCES
|
|||||||
test_misc.cpp
|
test_misc.cpp
|
||||||
test_pattern_formatter.cpp
|
test_pattern_formatter.cpp
|
||||||
test_async.cpp
|
test_async.cpp
|
||||||
includes.h
|
|
||||||
test_registry.cpp
|
test_registry.cpp
|
||||||
test_macros.cpp
|
test_macros.cpp
|
||||||
utils.cpp
|
utils.cpp
|
||||||
utils.h
|
|
||||||
main.cpp
|
main.cpp
|
||||||
test_mpmc_q.cpp
|
test_mpmc_q.cpp
|
||||||
test_sink.h
|
|
||||||
test_dup_filter.cpp
|
test_dup_filter.cpp
|
||||||
test_fmt_helper.cpp
|
test_fmt_helper.cpp
|
||||||
test_stdout_api.cpp
|
test_stdout_api.cpp
|
||||||
|
@ -5,19 +5,18 @@ test_sources = files([
|
|||||||
'test_misc.cpp',
|
'test_misc.cpp',
|
||||||
'test_pattern_formatter.cpp',
|
'test_pattern_formatter.cpp',
|
||||||
'test_async.cpp',
|
'test_async.cpp',
|
||||||
'includes.h',
|
|
||||||
'test_registry.cpp',
|
'test_registry.cpp',
|
||||||
'test_macros.cpp',
|
'test_macros.cpp',
|
||||||
'utils.cpp',
|
'utils.cpp',
|
||||||
'main.cpp',
|
'main.cpp',
|
||||||
'test_mpmc_q.cpp',
|
'test_mpmc_q.cpp',
|
||||||
|
'test_dup_filter.cpp',
|
||||||
'test_fmt_helper.cpp',
|
'test_fmt_helper.cpp',
|
||||||
'test_stdout_api.cpp',
|
'test_stdout_api.cpp',
|
||||||
'test_dup_filter.cpp',
|
'test_backtrace.cpp',
|
||||||
'test_backtrace.cpp'
|
'test_create_dir.cpp'
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
if not get_option('no_exceptions')
|
if not get_option('no_exceptions')
|
||||||
test_sources += 'test_errors.cpp'
|
test_sources += 'test_errors.cpp'
|
||||||
endif
|
endif
|
||||||
@ -38,13 +37,12 @@ endif
|
|||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
# --- Build the test executables ---
|
# --- Build the test executables ---
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
if get_option('enable_tests')
|
||||||
|
test_exe = executable('spdlog-utests', test_sources, dependencies: global_test_deps + [spdlog_dep])
|
||||||
|
test('test_spdlog', test_exe, is_parallel : false)
|
||||||
|
endif
|
||||||
|
|
||||||
test_matrix = [
|
if get_option('enable_tests_ho')
|
||||||
['spdlog-utests', spdlog_dep],
|
test_exe = executable('spdlog-utests-ho', test_sources, dependencies: global_test_deps + [spdlog_headeronly_dep])
|
||||||
['spdlog-utests-ho', spdlog_headeronly_dep],
|
test('test_spdlog-ho', test_exe, is_parallel : false)
|
||||||
]
|
endif
|
||||||
|
|
||||||
foreach i : test_matrix
|
|
||||||
test_exe = executable(i[0], test_sources, dependencies: global_test_deps + [i[1]])
|
|
||||||
test('test_' + i[0], test_exe)
|
|
||||||
endforeach
|
|
Loading…
x
Reference in New Issue
Block a user