Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
937fe7e9
Commit
937fe7e9
authored
May 02, 2020
by
Bruce Mitchener
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: Fix tabs, whitespace at EOL.
parent
89ab1e67
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
54 deletions
+54
-54
CMakeLists.txt
CMakeLists.txt
+10
-10
cmake/utils.cmake
cmake/utils.cmake
+25
-25
cmake/version.rc.in
cmake/version.rc.in
+1
-1
example/CMakeLists.txt
example/CMakeLists.txt
+1
-1
tests/CMakeLists.txt
tests/CMakeLists.txt
+17
-17
No files found.
CMakeLists.txt
View file @
937fe7e9
...
...
@@ -43,7 +43,7 @@ endif()
set
(
CMAKE_CXX_EXTENSIONS OFF
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"CYGWIN"
)
set
(
CMAKE_CXX_EXTENSIONS ON
)
set
(
CMAKE_CXX_EXTENSIONS ON
)
endif
()
...
...
@@ -109,7 +109,7 @@ option(SPDLOG_NO_TLS "prevent spdlog from using thread local storage" OFF)
option
(
SPDLOG_NO_ATOMIC_LEVELS
"prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently"
OFF
)
# clang-tidy
if
(
${
CMAKE_VERSION
}
VERSION_GREATER
"3.5"
)
if
(
${
CMAKE_VERSION
}
VERSION_GREATER
"3.5"
)
option
(
SPDLOG_TIDY
"run clang-tidy"
OFF
)
endif
()
...
...
@@ -127,7 +127,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
set
(
SPDLOG_SRCS
src/spdlog.cpp
src/stdout_sinks.cpp
src/color_sinks.cpp
src/color_sinks.cpp
src/file_sinks.cpp
src/async.cpp
src/cfg.cpp
)
...
...
@@ -145,7 +145,7 @@ if (SPDLOG_BUILD_SHARED)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_SHARED_LIB
)
if
(
WIN32
)
target_compile_options
(
spdlog PUBLIC /wd4251 /wd4275
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/version.rc.in
${
CMAKE_CURRENT_BINARY_DIR
}
/version.rc @ONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/version.rc.in
${
CMAKE_CURRENT_BINARY_DIR
}
/version.rc @ONLY
)
endif
()
if
(
NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO
)
target_compile_definitions
(
spdlog PRIVATE FMT_EXPORT PUBLIC FMT_SHARED
)
...
...
@@ -209,19 +209,19 @@ endif()
# Misc definitions according to tweak options
#---------------------------------------------------------------------------------------
if
(
SPDLOG_WCHAR_SUPPORT
)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_WCHAR_TO_UTF8_SUPPORT
)
target_compile_definitions
(
spdlog_header_only INTERFACE SPDLOG_WCHAR_TO_UTF8_SUPPORT
)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_WCHAR_TO_UTF8_SUPPORT
)
target_compile_definitions
(
spdlog_header_only INTERFACE SPDLOG_WCHAR_TO_UTF8_SUPPORT
)
endif
()
if
(
SPDLOG_WCHAR_FILENAMES
)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_WCHAR_FILENAMES
)
target_compile_definitions
(
spdlog_header_only INTERFACE SPDLOG_WCHAR_FILENAMES
)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_WCHAR_FILENAMES
)
target_compile_definitions
(
spdlog_header_only INTERFACE SPDLOG_WCHAR_FILENAMES
)
endif
()
if
(
SPDLOG_NO_EXCEPTIONS
)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_NO_EXCEPTIONS
)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_NO_EXCEPTIONS
)
target_compile_definitions
(
spdlog_header_only INTERFACE SPDLOG_NO_EXCEPTIONS
)
target_compile_definitions
(
spdlog_header_only INTERFACE SPDLOG_NO_EXCEPTIONS
)
if
(
NOT MSVC
)
target_compile_options
(
spdlog PRIVATE -fno-exceptions
)
...
...
cmake/utils.cmake
View file @
937fe7e9
# Get spdlog version from include/spdlog/version.h and put it in SPDLOG_VERSION
function
(
spdlog_extract_version
)
file
(
READ
"
${
CMAKE_CURRENT_LIST_DIR
}
/include/spdlog/version.h"
file_contents
)
string
(
REGEX MATCH
"SPDLOG_VER_MAJOR ([0-9]+)"
_
"
${
file_contents
}
"
)
if
(
NOT CMAKE_MATCH_COUNT EQUAL 1
)
file
(
READ
"
${
CMAKE_CURRENT_LIST_DIR
}
/include/spdlog/version.h"
file_contents
)
string
(
REGEX MATCH
"SPDLOG_VER_MAJOR ([0-9]+)"
_
"
${
file_contents
}
"
)
if
(
NOT CMAKE_MATCH_COUNT EQUAL 1
)
message
(
FATAL_ERROR
"Could not extract major version number from spdlog/version.h"
)
endif
()
set
(
ver_major
${
CMAKE_MATCH_1
}
)
endif
()
set
(
ver_major
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"SPDLOG_VER_MINOR ([0-9]+)"
_
"
${
file_contents
}
"
)
if
(
NOT CMAKE_MATCH_COUNT EQUAL 1
)
string
(
REGEX MATCH
"SPDLOG_VER_MINOR ([0-9]+)"
_
"
${
file_contents
}
"
)
if
(
NOT CMAKE_MATCH_COUNT EQUAL 1
)
message
(
FATAL_ERROR
"Could not extract minor version number from spdlog/version.h"
)
endif
()
endif
()
set
(
ver_minor
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"SPDLOG_VER_PATCH ([0-9]+)"
_
"
${
file_contents
}
"
)
if
(
NOT CMAKE_MATCH_COUNT EQUAL 1
)
set
(
ver_minor
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"SPDLOG_VER_PATCH ([0-9]+)"
_
"
${
file_contents
}
"
)
if
(
NOT CMAKE_MATCH_COUNT EQUAL 1
)
message
(
FATAL_ERROR
"Could not extract patch version number from spdlog/version.h"
)
endif
()
set
(
ver_patch
${
CMAKE_MATCH_1
}
)
endif
()
set
(
ver_patch
${
CMAKE_MATCH_1
}
)
set
(
SPDLOG_VERSION_MAJOR
${
ver_major
}
PARENT_SCOPE
)
set
(
SPDLOG_VERSION_MINOR
${
ver_minor
}
PARENT_SCOPE
)
set
(
SPDLOG_VERSION_PATCH
${
ver_patch
}
PARENT_SCOPE
)
set
(
SPDLOG_VERSION
"
${
ver_major
}
.
${
ver_minor
}
.
${
ver_patch
}
"
PARENT_SCOPE
)
set
(
SPDLOG_VERSION_MINOR
${
ver_minor
}
PARENT_SCOPE
)
set
(
SPDLOG_VERSION_PATCH
${
ver_patch
}
PARENT_SCOPE
)
set
(
SPDLOG_VERSION
"
${
ver_major
}
.
${
ver_minor
}
.
${
ver_patch
}
"
PARENT_SCOPE
)
endfunction
()
...
...
@@ -47,13 +47,13 @@ endfunction()
# Enable address sanitizer (gcc/clang only)
function
(
spdlog_enable_sanitizer target_name
)
if
(
NOT CMAKE_CXX_COMPILER_ID MATCHES
"GNU|Clang"
)
message
(
FATAL_ERROR
"Sanitizer supported only for gcc/clang"
)
endif
()
message
(
STATUS
"Address sanitizer enabled"
)
target_compile_options
(
${
target_name
}
PRIVATE -fsanitize=address,undefined
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-sanitize=signed-integer-overflow
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-sanitize-recover=all
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-omit-frame-pointer
)
target_link_libraries
(
${
target_name
}
PRIVATE -fsanitize=address,undefined -fuse-ld=gold
)
if
(
NOT CMAKE_CXX_COMPILER_ID MATCHES
"GNU|Clang"
)
message
(
FATAL_ERROR
"Sanitizer supported only for gcc/clang"
)
endif
()
message
(
STATUS
"Address sanitizer enabled"
)
target_compile_options
(
${
target_name
}
PRIVATE -fsanitize=address,undefined
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-sanitize=signed-integer-overflow
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-sanitize-recover=all
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-omit-frame-pointer
)
target_link_libraries
(
${
target_name
}
PRIVATE -fsanitize=address,undefined -fuse-ld=gold
)
endfunction
()
cmake/version.rc.in
View file @
937fe7e9
...
...
@@ -21,7 +21,7 @@ BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
BEGIN
VALUE "FileDescription", "spdlog dll\0"
VALUE "FileVersion", "@SPDLOG_VERSION@.0\0"
VALUE "InternalName", "spdlog.dll\0"
...
...
example/CMakeLists.txt
View file @
937fe7e9
...
...
@@ -19,7 +19,7 @@ target_link_libraries(example PRIVATE spdlog::spdlog)
# Example of using header-only library
#---------------------------------------------------------------------------------------
if
(
SPDLOG_BUILD_EXAMPLE_HO
)
add_executable
(
example_header_only example.cpp
)
add_executable
(
example_header_only example.cpp
)
target_link_libraries
(
example_header_only PRIVATE spdlog::spdlog_header_only
)
endif
()
tests/CMakeLists.txt
View file @
937fe7e9
...
...
@@ -11,13 +11,13 @@ include(../cmake/utils.cmake)
find_package
(
PkgConfig
)
if
(
PkgConfig_FOUND
)
pkg_check_modules
(
systemd libsystemd
)
pkg_check_modules
(
systemd libsystemd
)
endif
()
set
(
SPDLOG_UTESTS_SOURCES
test_file_helper.cpp
test_file_logging.cpp
test_daily_logger.cpp
test_daily_logger.cpp
test_misc.cpp
test_eventlog.cpp
test_pattern_formatter.cpp
...
...
@@ -27,20 +27,20 @@ set(SPDLOG_UTESTS_SOURCES
utils.cpp
main.cpp
test_mpmc_q.cpp
test_dup_filter.cpp
test_dup_filter.cpp
test_fmt_helper.cpp
test_stdout_api.cpp
test_backtrace.cpp
test_create_dir.cpp
test_cfg.cpp
test_time_point.cpp
)
test_stdout_api.cpp
test_backtrace.cpp
test_create_dir.cpp
test_cfg.cpp
test_time_point.cpp
)
if
(
NOT SPDLOG_NO_EXCEPTIONS
)
list
(
APPEND SPDLOG_UTESTS_SOURCES test_errors.cpp
)
list
(
APPEND SPDLOG_UTESTS_SOURCES test_errors.cpp
)
endif
()
if
(
systemd_FOUND
)
list
(
APPEND SPDLOG_UTESTS_SOURCES test_systemd.cpp
)
list
(
APPEND SPDLOG_UTESTS_SOURCES test_systemd.cpp
)
endif
()
...
...
@@ -48,14 +48,14 @@ enable_testing()
function
(
spdlog_prepare_test test_target spdlog_lib
)
add_executable
(
${
test_target
}
${
SPDLOG_UTESTS_SOURCES
}
)
spdlog_enable_warnings
(
${
test_target
}
)
spdlog_enable_warnings
(
${
test_target
}
)
target_link_libraries
(
${
test_target
}
PRIVATE
${
spdlog_lib
}
)
if
(
systemd_FOUND
)
target_link_libraries
(
${
test_target
}
PRIVATE
${
systemd_LIBRARIES
}
)
endif
()
if
(
SPDLOG_SANITIZE_ADDRESS
)
spdlog_enable_sanitizer
(
${
test_target
}
)
endif
()
if
(
systemd_FOUND
)
target_link_libraries
(
${
test_target
}
PRIVATE
${
systemd_LIBRARIES
}
)
endif
()
if
(
SPDLOG_SANITIZE_ADDRESS
)
spdlog_enable_sanitizer
(
${
test_target
}
)
endif
()
add_test
(
NAME
${
test_target
}
COMMAND
${
test_target
}
)
set_tests_properties
(
${
test_target
}
PROPERTIES RUN_SERIAL ON
)
endfunction
()
...
...
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