Loading CMakeLists.txt +18 −7 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF) if(WIN32) option(SPDLOG_WCHAR_SUPPORT "Support wchar api" OFF) option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF) endif() option(SPDLOG_NO_EXCEPTIONS "Compile with -fno-exceptions. Call abort() on any spdlog exceptions" OFF) Loading @@ -86,8 +87,6 @@ set(SPDLOG_SRCS src/file_sinks.cpp src/async.cpp) set(SPDLOG_CFLAGS "${PROJECT_NAME}") if (SPDLOG_BUILD_SHARED) if(WIN32) message(FATAL_ERROR "spdlog shared lib is not yet supported under windows") Loading Loading @@ -128,14 +127,13 @@ if(SPDLOG_FMT_EXTERNAL) if (NOT TARGET fmt::fmt) find_package(fmt REQUIRED) endif () set(SPDLOG_CFLAGS "${SPDLOG_CFLAGS} -DSPDLOG_FMT_EXTERNAL") target_compile_definitions(spdlog PUBLIC SPDLOG_FMT_EXTERNAL) target_link_libraries(spdlog PUBLIC fmt::fmt) target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL) target_link_libraries(spdlog_header_only INTERFACE fmt::fmt) set(PKG_CONFIG_REQUIRES fmt) # add dependecy to pkg-config endif() if(SPDLOG_WCHAR_SUPPORT) Loading @@ -143,6 +141,11 @@ if(SPDLOG_WCHAR_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) endif() if(SPDLOG_NO_EXCEPTIONS) target_compile_definitions(spdlog PUBLIC SPDLOG_NO_EXCEPTIONS) Loading Loading @@ -190,7 +193,7 @@ if (SPDLOG_INSTALL) # Include files #--------------------------------------------------------------------------------------- install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PATTERN "fmt/bundled" EXCLUDE) install(TARGETS spdlog spdlog_header_only EXPORT spdlog DESTINATION "${CMAKE_INSTALL_LIBDIR}/spdlog") install(TARGETS spdlog spdlog_header_only EXPORT spdlog DESTINATION "${CMAKE_INSTALL_LIBDIR}") if(NOT SPDLOG_FMT_EXTERNAL) install(DIRECTORY include/${PROJECT_NAME}/fmt/bundled/ Loading @@ -198,11 +201,17 @@ if (SPDLOG_INSTALL) endif() #--------------------------------------------------------------------------------------- # Package and version files # Install pkg-config file #--------------------------------------------------------------------------------------- get_target_property(PKG_CONFIG_DEFINES spdlog INTERFACE_COMPILE_DEFINITIONS) string(REPLACE ";" " -D" PKG_CONFIG_DEFINES "${PKG_CONFIG_DEFINES}") string(CONCAT PKG_CONFIG_DEFINES "-D" "${PKG_CONFIG_DEFINES}") configure_file("cmake/${PROJECT_NAME}.pc.in" "${pkg_config}" @ONLY) install(FILES "${pkg_config}" DESTINATION "${pkgconfig_install_dir}") #--------------------------------------------------------------------------------------- # Install CMake config files #--------------------------------------------------------------------------------------- install(EXPORT spdlog DESTINATION ${export_dest_dir} NAMESPACE spdlog:: Loading @@ -210,6 +219,7 @@ if (SPDLOG_INSTALL) include(CMakePackageConfigHelpers) configure_file("${project_config_in}" "${project_config_out}" @ONLY) write_basic_package_version_file("${version_config_file}" COMPATIBILITY SameMajorVersion) install(FILES "${project_config_out}" Loading @@ -221,3 +231,4 @@ if (SPDLOG_INSTALL) include(cmake/spdlogCPack.cmake) endif () README.md +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ Very fast, header-only/compiled, C++ logging library. [ to your build tree and use a C++11 compiler. #### Static lib version (recommended - much faster compile times, v1.4.0) #### Static lib version (recommended - much faster compile times) ```console $ git clone https://github.com/gabime/spdlog.git $ cd spdlog && mkdir build && cd build Loading cmake/spdlog.pc.in +4 −2 Original line number Diff line number Diff line Loading @@ -7,5 +7,7 @@ Name: lib@PROJECT_NAME@ Description: Fast C++ logging library. URL: https://github.com/gabime/@PROJECT_NAME@ Version: @SPDLOG_VERSION@ CFlags: -I${includedir}/@SPDLOG_CFLAGS@ Libs: -L${libdir}/@PROJECT_NAME@ -l@PROJECT_NAME@ CFlags: -I${includedir} @PKG_CONFIG_DEFINES@ Libs: -L${libdir} -lspdlog -pthread Requires: @PKG_CONFIG_REQUIRES@ cmake/spdlogCPack.cmake +6 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ set(CPACK_INSTALL_CMAKE_PROJECTS set(CPACK_PROJECT_URL "https://github.com/gabime/spdlog") set(CPACK_PACKAGE_VENDOR "Gabi Melman") set(CPACK_PACKAGE_CONTACT "Gabi Melman <gmelman1@gmail.com>") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fast C++ logging library") set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) Loading @@ -23,4 +24,9 @@ if (PROJECT_VERSION_TWEAK) endif () set(CPACK_PACKAGE_RELOCATABLE ON) set(CPACK_RPM_PACKAGE_LICENSE "MIT") set(CPACK_RPM_PACKAGE_GROUP "System Environment/Libraries") set(CPACK_RPM_PACKAGE_URL ${CPACK_PROJECT_URL}) set(CPACK_RPM_PACKAGE_DESCRIPTION "Very fast, header-only/compiled, C++ logging library.") include(CPack) include/spdlog/common.h +1 −2 Original line number Diff line number Diff line Loading @@ -101,14 +101,13 @@ using sink_ptr = std::shared_ptr<sinks::sink>; using sinks_init_list = std::initializer_list<sink_ptr>; using err_handler = std::function<void(const std::string &err_msg)>; using string_view_t = fmt::basic_string_view<char>; using wstring_view_t = fmt::basic_string_view<wchar_t>; using memory_buf_t = fmt::basic_memory_buffer<char, 250>; #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT #ifndef _WIN32 #error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows #else using wstring_view_t = fmt::basic_string_view<wchar_t>; template<typename T> struct is_convertible_to_wstring_view : std::is_convertible<T, wstring_view_t> {}; Loading Loading
CMakeLists.txt +18 −7 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF) if(WIN32) option(SPDLOG_WCHAR_SUPPORT "Support wchar api" OFF) option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF) endif() option(SPDLOG_NO_EXCEPTIONS "Compile with -fno-exceptions. Call abort() on any spdlog exceptions" OFF) Loading @@ -86,8 +87,6 @@ set(SPDLOG_SRCS src/file_sinks.cpp src/async.cpp) set(SPDLOG_CFLAGS "${PROJECT_NAME}") if (SPDLOG_BUILD_SHARED) if(WIN32) message(FATAL_ERROR "spdlog shared lib is not yet supported under windows") Loading Loading @@ -128,14 +127,13 @@ if(SPDLOG_FMT_EXTERNAL) if (NOT TARGET fmt::fmt) find_package(fmt REQUIRED) endif () set(SPDLOG_CFLAGS "${SPDLOG_CFLAGS} -DSPDLOG_FMT_EXTERNAL") target_compile_definitions(spdlog PUBLIC SPDLOG_FMT_EXTERNAL) target_link_libraries(spdlog PUBLIC fmt::fmt) target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL) target_link_libraries(spdlog_header_only INTERFACE fmt::fmt) set(PKG_CONFIG_REQUIRES fmt) # add dependecy to pkg-config endif() if(SPDLOG_WCHAR_SUPPORT) Loading @@ -143,6 +141,11 @@ if(SPDLOG_WCHAR_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) endif() if(SPDLOG_NO_EXCEPTIONS) target_compile_definitions(spdlog PUBLIC SPDLOG_NO_EXCEPTIONS) Loading Loading @@ -190,7 +193,7 @@ if (SPDLOG_INSTALL) # Include files #--------------------------------------------------------------------------------------- install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PATTERN "fmt/bundled" EXCLUDE) install(TARGETS spdlog spdlog_header_only EXPORT spdlog DESTINATION "${CMAKE_INSTALL_LIBDIR}/spdlog") install(TARGETS spdlog spdlog_header_only EXPORT spdlog DESTINATION "${CMAKE_INSTALL_LIBDIR}") if(NOT SPDLOG_FMT_EXTERNAL) install(DIRECTORY include/${PROJECT_NAME}/fmt/bundled/ Loading @@ -198,11 +201,17 @@ if (SPDLOG_INSTALL) endif() #--------------------------------------------------------------------------------------- # Package and version files # Install pkg-config file #--------------------------------------------------------------------------------------- get_target_property(PKG_CONFIG_DEFINES spdlog INTERFACE_COMPILE_DEFINITIONS) string(REPLACE ";" " -D" PKG_CONFIG_DEFINES "${PKG_CONFIG_DEFINES}") string(CONCAT PKG_CONFIG_DEFINES "-D" "${PKG_CONFIG_DEFINES}") configure_file("cmake/${PROJECT_NAME}.pc.in" "${pkg_config}" @ONLY) install(FILES "${pkg_config}" DESTINATION "${pkgconfig_install_dir}") #--------------------------------------------------------------------------------------- # Install CMake config files #--------------------------------------------------------------------------------------- install(EXPORT spdlog DESTINATION ${export_dest_dir} NAMESPACE spdlog:: Loading @@ -210,6 +219,7 @@ if (SPDLOG_INSTALL) include(CMakePackageConfigHelpers) configure_file("${project_config_in}" "${project_config_out}" @ONLY) write_basic_package_version_file("${version_config_file}" COMPATIBILITY SameMajorVersion) install(FILES "${project_config_out}" Loading @@ -221,3 +231,4 @@ if (SPDLOG_INSTALL) include(cmake/spdlogCPack.cmake) endif ()
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ Very fast, header-only/compiled, C++ logging library. [ to your build tree and use a C++11 compiler. #### Static lib version (recommended - much faster compile times, v1.4.0) #### Static lib version (recommended - much faster compile times) ```console $ git clone https://github.com/gabime/spdlog.git $ cd spdlog && mkdir build && cd build Loading
cmake/spdlog.pc.in +4 −2 Original line number Diff line number Diff line Loading @@ -7,5 +7,7 @@ Name: lib@PROJECT_NAME@ Description: Fast C++ logging library. URL: https://github.com/gabime/@PROJECT_NAME@ Version: @SPDLOG_VERSION@ CFlags: -I${includedir}/@SPDLOG_CFLAGS@ Libs: -L${libdir}/@PROJECT_NAME@ -l@PROJECT_NAME@ CFlags: -I${includedir} @PKG_CONFIG_DEFINES@ Libs: -L${libdir} -lspdlog -pthread Requires: @PKG_CONFIG_REQUIRES@
cmake/spdlogCPack.cmake +6 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ set(CPACK_INSTALL_CMAKE_PROJECTS set(CPACK_PROJECT_URL "https://github.com/gabime/spdlog") set(CPACK_PACKAGE_VENDOR "Gabi Melman") set(CPACK_PACKAGE_CONTACT "Gabi Melman <gmelman1@gmail.com>") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fast C++ logging library") set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) Loading @@ -23,4 +24,9 @@ if (PROJECT_VERSION_TWEAK) endif () set(CPACK_PACKAGE_RELOCATABLE ON) set(CPACK_RPM_PACKAGE_LICENSE "MIT") set(CPACK_RPM_PACKAGE_GROUP "System Environment/Libraries") set(CPACK_RPM_PACKAGE_URL ${CPACK_PROJECT_URL}) set(CPACK_RPM_PACKAGE_DESCRIPTION "Very fast, header-only/compiled, C++ logging library.") include(CPack)
include/spdlog/common.h +1 −2 Original line number Diff line number Diff line Loading @@ -101,14 +101,13 @@ using sink_ptr = std::shared_ptr<sinks::sink>; using sinks_init_list = std::initializer_list<sink_ptr>; using err_handler = std::function<void(const std::string &err_msg)>; using string_view_t = fmt::basic_string_view<char>; using wstring_view_t = fmt::basic_string_view<wchar_t>; using memory_buf_t = fmt::basic_memory_buffer<char, 250>; #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT #ifndef _WIN32 #error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows #else using wstring_view_t = fmt::basic_string_view<wchar_t>; template<typename T> struct is_convertible_to_wstring_view : std::is_convertible<T, wstring_view_t> {}; Loading