Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
69fcaf14
Commit
69fcaf14
authored
Apr 27, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip static-lib
parent
f414198f
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
43 additions
and
55 deletions
+43
-55
CMakeLists.txt
CMakeLists.txt
+14
-29
async_logger.h
include/spdlog/async_logger.h
+2
-2
common.h
include/spdlog/common.h
+4
-3
file_helper.h
include/spdlog/details/file_helper.h
+2
-2
log_msg.h
include/spdlog/details/log_msg.h
+2
-2
os.h
include/spdlog/details/os.h
+1
-1
pattern_formatter.h
include/spdlog/details/pattern_formatter.h
+1
-1
registry.h
include/spdlog/details/registry.h
+2
-2
thread_pool.h
include/spdlog/details/thread_pool.h
+2
-0
async_logger.cpp
include/spdlog/impl/async_logger.cpp
+1
-1
file_helper.cpp
include/spdlog/impl/file_helper.cpp
+1
-1
log_msg.cpp
include/spdlog/impl/log_msg.cpp
+1
-1
logger.cpp
include/spdlog/impl/logger.cpp
+1
-1
os.cpp
include/spdlog/impl/os.cpp
+1
-1
pattern_formatter.cpp
include/spdlog/impl/pattern_formatter.cpp
+2
-2
registry.cpp
include/spdlog/impl/registry.cpp
+1
-1
sink.cpp
include/spdlog/impl/sink.cpp
+1
-1
logger.h
include/spdlog/logger.h
+2
-2
sink.h
include/spdlog/sinks/sink.h
+2
-2
No files found.
CMakeLists.txt
View file @
69fcaf14
#
# Copyright(c) 2015 Ruslan Baratov.
# Copyright(c) 2019 spdlog
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
#
cmake_minimum_required
(
VERSION 3.1
)
project
(
spdlog VERSION 1.3.1 LANGUAGES CXX
)
...
...
@@ -47,48 +44,36 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set
(
SPDLOG_MASTER_PROJECT ON
)
endif
()
option
(
SPDLOG_
HEADER_ONLY
"Header only version. Turn OFF to b
uild as static lib"
OFF
)
option
(
SPDLOG_
STATIC_LIB
"B
uild as static lib"
OFF
)
option
(
SPDLOG_BUILD_EXAMPLES
"Build examples"
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_BUILD_BENCH
"Build benchmarks (Requires https://github.com/google/benchmark.git to be installed)"
ON
)
option
(
SPDLOG_BUILD_TESTS
"Build tests"
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_FMT_EXTERNAL
"Use external fmt library instead of bundled"
OFF
)
option
(
SPDLOG_INSTALL
"Generate the install target."
${
SPDLOG_MASTER_PROJECT
}
)
set
(
HEADER_BASE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
)
if
(
SPDLOG_HEADER_ONLY
)
add_definitions
(
-DSPDLOG_HEADER_ONLY
)
add_library
(
spdlog INTERFACE
)
add_library
(
spdlog::spdlog ALIAS spdlog
)
target_include_directories
(
spdlog
INTERFACE
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_LIST_DIR
}
/include>"
)
set
(
HEADER_BASE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include/spdlog"
)
else
(
)
remove_definitions
(
-DSPDLOG_HEADER_ONLY
)
file
(
GLOB SRC_FILES
${
HEADER_BASE
}
/
spdlog/
impl/*.cpp
)
if
(
SPDLOG_STATIC_LIB
)
add_definitions
(
-DSPDLOG_STATIC_LIB
)
file
(
GLOB SRC_FILES
${
HEADER_BASE
}
/impl/*.cpp
)
add_library
(
spdlog STATIC
${
SRC_FILES
}
)
add_library
(
spdlog::spdlog ALIAS spdlog
)
target_include_directories
(
spdlog
PUBLIC
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_LIST_DIR
}
/include>"
)
target_include_directories
(
spdlog PUBLIC
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_LIST_DIR
}
/include>"
)
else
()
add_library
(
spdlog INTERFACE
)
target_include_directories
(
spdlog INTERFACE
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_LIST_DIR
}
/include>"
)
endif
()
add_library
(
spdlog::spdlog ALIAS spdlog
)
if
(
SPDLOG_FMT_EXTERNAL AND NOT TARGET fmt::fmt
)
find_package
(
fmt REQUIRED CONFIG
)
endif
()
if
(
SPDLOG_FMT_EXTERNAL
)
target_compile_definitions
(
spdlog INTERFACE SPDLOG_FMT_EXTERNAL
)
target_link_libraries
(
spdlog INTERFACE fmt::fmt
)
endif
()
if
(
SPDLOG_BUILD_EXAMPLES
)
add_subdirectory
(
example
)
endif
()
...
...
@@ -105,9 +90,9 @@ endif()
#---------------------------------------------------------------------------------------
# install
#---------------------------------------------------------------------------------------
install
(
DIRECTORY
${
HEADER_BASE
}
/spdlog
DESTINATION include
)
install
(
DIRECTORY
${
HEADER_BASE
}
DESTINATION include
)
if
(
NOT SPDLOG_HEADER_ONLY
)
if
(
SPDLOG_STATIC_LIB
)
install
(
TARGETS spdlog ARCHIVE DESTINATION lib
)
endif
()
...
...
include/spdlog/async_logger.h
View file @
69fcaf14
...
...
@@ -65,6 +65,6 @@ private:
};
}
// namespace spdlog
#if
def SPDLOG_HEADER_ONLY
#if
ndef SPDLOG_STATIC_LIB
#include "spdlog/impl/async_logger.cpp"
#endif
// SPDLOG_HEADER_ONLY
#endif
include/spdlog/common.h
View file @
69fcaf14
...
...
@@ -23,10 +23,11 @@
#include "spdlog/fmt/fmt.h"
#ifdef SPDLOG_HEADER_ONLY
#define SPDLOG_INLINE inline
#else
#ifdef SPDLOG_STATIC_LIB
#define SPDLOG_INLINE
#else
#define SPDLOG_INLINE inline
#endif
// visual studio upto 2013 does not support noexcept nor constexpr
...
...
include/spdlog/details/file_helper.h
View file @
69fcaf14
...
...
@@ -57,6 +57,6 @@ private:
}
// namespace details
}
// namespace spdlog
#if
def SPDLOG_HEADER_ONLY
#if
ndef SPDLOG_STATIC_LIB
#include "spdlog/impl/file_helper.cpp"
#endif
// ! SPDLOG_HEADER_ONLY
#endif
include/spdlog/details/log_msg.h
View file @
69fcaf14
...
...
@@ -33,6 +33,6 @@ struct log_msg
}
// namespace details
}
// namespace spdlog
#if
def SPDLOG_HEADER_ONLY
#if
ndef SPDLOG_STATIC_LIB
#include "spdlog/impl/log_msg.cpp"
#endif
// SPDLOG_HEADER_ONLY
#endif
include/spdlog/details/os.h
View file @
69fcaf14
...
...
@@ -88,6 +88,6 @@ void wbuf_to_utf8buf(const fmt::wmemory_buffer &wbuf, fmt::memory_buffer &target
}
// namespace details
}
// namespace spdlog
#if
def SPDLOG_HEADER_ONLY
#if
ndef SPDLOG_STATIC_LIB
#include "spdlog/impl/os.cpp"
#endif
include/spdlog/details/pattern_formatter.h
View file @
69fcaf14
...
...
@@ -97,6 +97,6 @@ private:
};
}
// namespace spdlog
#if
def SPDLOG_HEADER_ONLY
#if
ndef SPDLOG_STATIC_LIB
#include "spdlog/impl/pattern_formatter.cpp"
#endif
include/spdlog/details/registry.h
View file @
69fcaf14
...
...
@@ -101,6 +101,6 @@ private:
}
// namespace details
}
// namespace spdlog
#if
def SPDLOG_HEADER_ONLY
#if
ndef SPDLOG_STATIC_LIB
#include "spdlog/impl/registry.cpp"
#endif
// SPDLOG_HEADER_ONLY
#endif
include/spdlog/details/thread_pool.h
View file @
69fcaf14
...
...
@@ -11,6 +11,8 @@
#include <vector>
namespace
spdlog
{
class
async_logger
;
namespace
details
{
using
async_logger_ptr
=
std
::
shared_ptr
<
spdlog
::
async_logger
>
;
...
...
include/spdlog/impl/async_logger.cpp
View file @
69fcaf14
#if
ndef SPDLOG_HEADER_ONLY
#if
def SPDLOG_STATIC_LIB
#include "spdlog/async_logger.h"
#endif
...
...
include/spdlog/impl/file_helper.cpp
View file @
69fcaf14
...
...
@@ -3,7 +3,7 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#if
ndef SPDLOG_HEADER_ONLY
#if
def SPDLOG_STATIC_LIB
#include "spdlog/details/file_helper.h"
#endif
...
...
include/spdlog/impl/log_msg.cpp
View file @
69fcaf14
#include "spdlog/details/os.h"
#include "spdlog/sinks/sink.h"
#if
ndef SPDLOG_HEADER_ONLY
#if
def SPDLOG_STATIC_LIB
#include "spdlog/details/log_msg.h"
#endif
...
...
include/spdlog/impl/logger.cpp
View file @
69fcaf14
#if
ndef SPDLOG_HEADER_ONLY
#if
def SPDLOG_STATIC_LIB
#include "spdlog/logger.h"
#endif
...
...
include/spdlog/impl/os.cpp
View file @
69fcaf14
...
...
@@ -2,7 +2,7 @@
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#if
ndef SPDLOG_HEADER_ONLY
#if
def SPDLOG_STATIC_LIB
#include "spdlog/details/os.h"
#endif
...
...
include/spdlog/impl/pattern_formatter.cpp
View file @
69fcaf14
...
...
@@ -3,9 +3,9 @@
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#if
ndef SPDLOG_HEADER_ONLY
#if
def SPDLOG_STATIC_LIB
#include "spdlog/details/pattern_formatter.h"
#endif
// !SPDLOG_HEADER_ONLY
#endif
#include "spdlog/details/fmt_helper.h"
#include "spdlog/details/log_msg.h"
...
...
include/spdlog/impl/registry.cpp
View file @
69fcaf14
...
...
@@ -2,7 +2,7 @@
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#if
ndef SPDLOG_HEADER_ONLY
#if
def SPDLOG_STATIC_LIB
#include "spdlog/details/registry.h"
#endif
...
...
include/spdlog/impl/sink.cpp
View file @
69fcaf14
#include "spdlog/common.h"
#include "spdlog/details/pattern_formatter.h"
#if
ndef SPDLOG_HEADER_ONLY
#if
def SPDLOG_STATIC_LIB
#include "spdlog/sinks/sink.h"
#endif
...
...
include/spdlog/logger.h
View file @
69fcaf14
...
...
@@ -340,6 +340,6 @@ protected:
};
}
// namespace spdlog
#if
def SPDLOG_HEADER_ONLY
#if
ndef SPDLOG_STATIC_LIB
#include "spdlog/impl/logger.cpp"
#endif
// SPDLOG_HEADER_ONLY
#endif
include/spdlog/sinks/sink.h
View file @
69fcaf14
...
...
@@ -41,6 +41,6 @@ protected:
}
// namespace sinks
}
// namespace spdlog
#if
def SPDLOG_HEADER_ONLY
#if
ndef SPDLOG_STATIC_LIB
#include "spdlog/impl/sink.cpp"
#endif
// SPDLOG_HEADER_ONLY
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment