Commit 937fe7e9 authored by Bruce Mitchener's avatar Bruce Mitchener

cmake: Fix tabs, whitespace at EOL.

parent 89ab1e67
...@@ -43,7 +43,7 @@ endif() ...@@ -43,7 +43,7 @@ endif()
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN") if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
set(CMAKE_CXX_EXTENSIONS ON) set(CMAKE_CXX_EXTENSIONS ON)
endif() endif()
...@@ -109,7 +109,7 @@ option(SPDLOG_NO_TLS "prevent spdlog from using thread local storage" OFF) ...@@ -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) 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 # clang-tidy
if(${CMAKE_VERSION} VERSION_GREATER "3.5") if(${CMAKE_VERSION} VERSION_GREATER "3.5")
option(SPDLOG_TIDY "run clang-tidy" OFF) option(SPDLOG_TIDY "run clang-tidy" OFF)
endif() endif()
...@@ -127,7 +127,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) ...@@ -127,7 +127,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
set(SPDLOG_SRCS set(SPDLOG_SRCS
src/spdlog.cpp src/spdlog.cpp
src/stdout_sinks.cpp src/stdout_sinks.cpp
src/color_sinks.cpp src/color_sinks.cpp
src/file_sinks.cpp src/file_sinks.cpp
src/async.cpp src/async.cpp
src/cfg.cpp) src/cfg.cpp)
...@@ -145,7 +145,7 @@ if (SPDLOG_BUILD_SHARED) ...@@ -145,7 +145,7 @@ if (SPDLOG_BUILD_SHARED)
target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB) target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB)
if(WIN32) if(WIN32)
target_compile_options(spdlog PUBLIC /wd4251 /wd4275) 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() endif()
if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO) if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
target_compile_definitions(spdlog PRIVATE FMT_EXPORT PUBLIC FMT_SHARED) target_compile_definitions(spdlog PRIVATE FMT_EXPORT PUBLIC FMT_SHARED)
...@@ -209,19 +209,19 @@ endif() ...@@ -209,19 +209,19 @@ endif()
# Misc definitions according to tweak options # Misc definitions according to tweak options
#--------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------
if(SPDLOG_WCHAR_SUPPORT) if(SPDLOG_WCHAR_SUPPORT)
target_compile_definitions(spdlog PUBLIC 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) target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_WCHAR_TO_UTF8_SUPPORT)
endif() endif()
if(SPDLOG_WCHAR_FILENAMES) if(SPDLOG_WCHAR_FILENAMES)
target_compile_definitions(spdlog PUBLIC 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_header_only INTERFACE SPDLOG_WCHAR_FILENAMES)
endif() endif()
if(SPDLOG_NO_EXCEPTIONS) 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) if(NOT MSVC)
target_compile_options(spdlog PRIVATE -fno-exceptions) target_compile_options(spdlog PRIVATE -fno-exceptions)
......
# Get spdlog version from include/spdlog/version.h and put it in SPDLOG_VERSION # Get spdlog version from include/spdlog/version.h and put it in SPDLOG_VERSION
function(spdlog_extract_version) function(spdlog_extract_version)
file(READ "${CMAKE_CURRENT_LIST_DIR}/include/spdlog/version.h" file_contents) file(READ "${CMAKE_CURRENT_LIST_DIR}/include/spdlog/version.h" file_contents)
string(REGEX MATCH "SPDLOG_VER_MAJOR ([0-9]+)" _ "${file_contents}") string(REGEX MATCH "SPDLOG_VER_MAJOR ([0-9]+)" _ "${file_contents}")
if(NOT CMAKE_MATCH_COUNT EQUAL 1) if(NOT CMAKE_MATCH_COUNT EQUAL 1)
message(FATAL_ERROR "Could not extract major version number from spdlog/version.h") message(FATAL_ERROR "Could not extract major version number from spdlog/version.h")
endif() endif()
set(ver_major ${CMAKE_MATCH_1}) set(ver_major ${CMAKE_MATCH_1})
string(REGEX MATCH "SPDLOG_VER_MINOR ([0-9]+)" _ "${file_contents}") string(REGEX MATCH "SPDLOG_VER_MINOR ([0-9]+)" _ "${file_contents}")
if(NOT CMAKE_MATCH_COUNT EQUAL 1) if(NOT CMAKE_MATCH_COUNT EQUAL 1)
message(FATAL_ERROR "Could not extract minor version number from spdlog/version.h") message(FATAL_ERROR "Could not extract minor version number from spdlog/version.h")
endif() endif()
set(ver_minor ${CMAKE_MATCH_1}) set(ver_minor ${CMAKE_MATCH_1})
string(REGEX MATCH "SPDLOG_VER_PATCH ([0-9]+)" _ "${file_contents}") string(REGEX MATCH "SPDLOG_VER_PATCH ([0-9]+)" _ "${file_contents}")
if(NOT CMAKE_MATCH_COUNT EQUAL 1) if(NOT CMAKE_MATCH_COUNT EQUAL 1)
message(FATAL_ERROR "Could not extract patch version number from spdlog/version.h") message(FATAL_ERROR "Could not extract patch version number from spdlog/version.h")
endif() endif()
set(ver_patch ${CMAKE_MATCH_1}) set(ver_patch ${CMAKE_MATCH_1})
set(SPDLOG_VERSION_MAJOR ${ver_major} PARENT_SCOPE) set(SPDLOG_VERSION_MAJOR ${ver_major} PARENT_SCOPE)
set(SPDLOG_VERSION_MINOR ${ver_minor} PARENT_SCOPE) set(SPDLOG_VERSION_MINOR ${ver_minor} PARENT_SCOPE)
set(SPDLOG_VERSION_PATCH ${ver_patch} PARENT_SCOPE) set(SPDLOG_VERSION_PATCH ${ver_patch} PARENT_SCOPE)
set (SPDLOG_VERSION "${ver_major}.${ver_minor}.${ver_patch}" PARENT_SCOPE) set (SPDLOG_VERSION "${ver_major}.${ver_minor}.${ver_patch}" PARENT_SCOPE)
endfunction() endfunction()
...@@ -47,13 +47,13 @@ endfunction() ...@@ -47,13 +47,13 @@ endfunction()
# Enable address sanitizer (gcc/clang only) # Enable address sanitizer (gcc/clang only)
function(spdlog_enable_sanitizer target_name) function(spdlog_enable_sanitizer target_name)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") if (NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
message(FATAL_ERROR "Sanitizer supported only for gcc/clang") message(FATAL_ERROR "Sanitizer supported only for gcc/clang")
endif() endif()
message(STATUS "Address sanitizer enabled") message(STATUS "Address sanitizer enabled")
target_compile_options(${target_name} PRIVATE -fsanitize=address,undefined) 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=signed-integer-overflow)
target_compile_options(${target_name} PRIVATE -fno-sanitize-recover=all) target_compile_options(${target_name} PRIVATE -fno-sanitize-recover=all)
target_compile_options(${target_name} PRIVATE -fno-omit-frame-pointer) target_compile_options(${target_name} PRIVATE -fno-omit-frame-pointer)
target_link_libraries(${target_name} PRIVATE -fsanitize=address,undefined -fuse-ld=gold) target_link_libraries(${target_name} PRIVATE -fsanitize=address,undefined -fuse-ld=gold)
endfunction() endfunction()
...@@ -21,7 +21,7 @@ BEGIN ...@@ -21,7 +21,7 @@ BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "FileDescription", "spdlog dll\0" VALUE "FileDescription", "spdlog dll\0"
VALUE "FileVersion", "@SPDLOG_VERSION@.0\0" VALUE "FileVersion", "@SPDLOG_VERSION@.0\0"
VALUE "InternalName", "spdlog.dll\0" VALUE "InternalName", "spdlog.dll\0"
......
...@@ -19,7 +19,7 @@ target_link_libraries(example PRIVATE spdlog::spdlog) ...@@ -19,7 +19,7 @@ target_link_libraries(example PRIVATE spdlog::spdlog)
# Example of using header-only library # Example of using header-only library
#--------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------
if(SPDLOG_BUILD_EXAMPLE_HO) 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) target_link_libraries(example_header_only PRIVATE spdlog::spdlog_header_only)
endif() endif()
...@@ -11,13 +11,13 @@ include(../cmake/utils.cmake) ...@@ -11,13 +11,13 @@ include(../cmake/utils.cmake)
find_package(PkgConfig) find_package(PkgConfig)
if(PkgConfig_FOUND) if(PkgConfig_FOUND)
pkg_check_modules(systemd libsystemd) pkg_check_modules(systemd libsystemd)
endif() endif()
set(SPDLOG_UTESTS_SOURCES set(SPDLOG_UTESTS_SOURCES
test_file_helper.cpp test_file_helper.cpp
test_file_logging.cpp test_file_logging.cpp
test_daily_logger.cpp test_daily_logger.cpp
test_misc.cpp test_misc.cpp
test_eventlog.cpp test_eventlog.cpp
test_pattern_formatter.cpp test_pattern_formatter.cpp
...@@ -27,20 +27,20 @@ set(SPDLOG_UTESTS_SOURCES ...@@ -27,20 +27,20 @@ set(SPDLOG_UTESTS_SOURCES
utils.cpp utils.cpp
main.cpp main.cpp
test_mpmc_q.cpp test_mpmc_q.cpp
test_dup_filter.cpp test_dup_filter.cpp
test_fmt_helper.cpp test_fmt_helper.cpp
test_stdout_api.cpp test_stdout_api.cpp
test_backtrace.cpp test_backtrace.cpp
test_create_dir.cpp test_create_dir.cpp
test_cfg.cpp test_cfg.cpp
test_time_point.cpp) test_time_point.cpp)
if(NOT SPDLOG_NO_EXCEPTIONS) if(NOT SPDLOG_NO_EXCEPTIONS)
list(APPEND SPDLOG_UTESTS_SOURCES test_errors.cpp) list(APPEND SPDLOG_UTESTS_SOURCES test_errors.cpp)
endif() endif()
if(systemd_FOUND) if(systemd_FOUND)
list(APPEND SPDLOG_UTESTS_SOURCES test_systemd.cpp) list(APPEND SPDLOG_UTESTS_SOURCES test_systemd.cpp)
endif() endif()
...@@ -48,14 +48,14 @@ enable_testing() ...@@ -48,14 +48,14 @@ enable_testing()
function(spdlog_prepare_test test_target spdlog_lib) function(spdlog_prepare_test test_target spdlog_lib)
add_executable(${test_target} ${SPDLOG_UTESTS_SOURCES}) 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}) target_link_libraries(${test_target} PRIVATE ${spdlog_lib})
if(systemd_FOUND) if(systemd_FOUND)
target_link_libraries(${test_target} PRIVATE ${systemd_LIBRARIES}) target_link_libraries(${test_target} PRIVATE ${systemd_LIBRARIES})
endif() endif()
if(SPDLOG_SANITIZE_ADDRESS) if(SPDLOG_SANITIZE_ADDRESS)
spdlog_enable_sanitizer(${test_target}) spdlog_enable_sanitizer(${test_target})
endif() endif()
add_test(NAME ${test_target} COMMAND ${test_target}) add_test(NAME ${test_target} COMMAND ${test_target})
set_tests_properties(${test_target} PROPERTIES RUN_SERIAL ON) set_tests_properties(${test_target} PROPERTIES RUN_SERIAL ON)
endfunction() endfunction()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment