diff --git a/ports/spdlog/CONTROL b/ports/spdlog/CONTROL index e7f91fc9457fad..21bcece3cf18e2 100644 --- a/ports/spdlog/CONTROL +++ b/ports/spdlog/CONTROL @@ -1,5 +1,5 @@ Source: spdlog -Version: 1.4.2-1 +Version: 1.6.0 Homepage: https://github.com/gabime/spdlog Description: Very fast, header only, C++ logging library Build-Depends: fmt @@ -7,3 +7,33 @@ Build-Depends: fmt Feature: benchmark Description: Use google benchmark Build-Depends: benchmark + +Feature: coarse-clock +Description: [Linux only] Use the much faster (but much less accurate) CLOCK_REALTIME_COARSE instead of regular clock + +Feature: disable-warnings +Description: Disable compiler warnings + +Feature: no-atomic-levels +Description: Prevent spdlog from using std::atomic log levels (use only if your code never modifies log levels concurrently) + +Feature: no-child-fd +Description: Prevent child processes from inheriting file descriptors + +Feature: no-exceptions +Description: Compile with -fno-exceptions. Calls abort() on any spdlog exceptions + +Feature: no-local-storage +Description: Prevent spdlog from using thread local storage + +Feature: no-thread-id +Description: Prevent spdlog from querying the thread id on each log call if thread id is not needed + +Feature: pch +Description: Build static or shared library using precompiled header to speed up compilation time + +Feature: shared +Description: Build shared library + +Feature: wchar +Description: [Windows only] Enable support for wide character log messages and file names diff --git a/ports/spdlog/disable-master-project-check.patch b/ports/spdlog/disable-master-project-check.patch deleted file mode 100644 index f39ec120a77a0e..00000000000000 --- a/ports/spdlog/disable-master-project-check.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 12320fb..70f611b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -33,13 +33,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) - # Set SPDLOG_MASTER_PROJECT to ON if we are building spdlog - #--------------------------------------------------------------------------------------- - # Check if spdlog is being used directly or via add_subdirectory, but allow overriding --if (NOT DEFINED SPDLOG_MASTER_PROJECT) -- if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) -- set(SPDLOG_MASTER_PROJECT ON) -- else() -- set(SPDLOG_MASTER_PROJECT OFF) -- endif() --endif () -+set(SPDLOG_MASTER_PROJECT OFF) - - # build shared option - if(NOT WIN32) diff --git a/ports/spdlog/fix-error-4275.patch b/ports/spdlog/fix-error-4275.patch deleted file mode 100644 index 4d1d8ee7d42b56..00000000000000 --- a/ports/spdlog/fix-error-4275.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cd17178..c9910e1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -126,6 +126,10 @@ if(SPDLOG_FMT_EXTERNAL) - - target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL) - target_link_libraries(spdlog_header_only INTERFACE fmt::fmt) -+ -+ if (WIN32) -+ target_compile_options(spdlog PRIVATE /wd4275) -+ endif() - - set(PKG_CONFIG_REQUIRES fmt) # add dependecy to pkg-config - endif() diff --git a/ports/spdlog/fix-feature-export.patch b/ports/spdlog/fix-feature-export.patch index 51dbd84738de58..f6fc70532cee35 100644 --- a/ports/spdlog/fix-feature-export.patch +++ b/ports/spdlog/fix-feature-export.patch @@ -1,14 +1,11 @@ diff --git a/bench/CMakeLists.txt b/bench/CMakeLists.txt -index d087cf6..86483db 100644 +index 0ea88423..9913ae64 100644 --- a/bench/CMakeLists.txt +++ b/bench/CMakeLists.txt -@@ -26,3 +26,8 @@ add_executable(formatter-bench formatter-bench.cpp) +@@ -26 +26,6 @@ add_executable(formatter-bench formatter-bench.cpp) target_link_libraries(formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog) - - file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs") + +install(TARGETS bench async_bench latency + RUNTIME DESTINATION tools/spdlog + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) -\ No newline at end of file diff --git a/ports/spdlog/fix-include.patch b/ports/spdlog/fix-include.patch deleted file mode 100644 index 7f5539201e2a7e..00000000000000 --- a/ports/spdlog/fix-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/include/spdlog/common.h b/include/spdlog/common.h -index e1108a0a..b4faf26e 100644 ---- a/include/spdlog/common.h -+++ b/include/spdlog/common.h -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - #ifdef _WIN32 - #ifndef NOMINMAX diff --git a/ports/spdlog/fix-includes-external-fmt.patch b/ports/spdlog/fix-includes-external-fmt.patch new file mode 100644 index 00000000000000..210009c463de62 --- /dev/null +++ b/ports/spdlog/fix-includes-external-fmt.patch @@ -0,0 +1,18 @@ +diff --git a/include/spdlog/fmt/fmt.h b/include/spdlog/fmt/fmt.h +index b853fd5e..a6e38046 100644 +--- a/include/spdlog/fmt/fmt.h ++++ b/include/spdlog/fmt/fmt.h +@@ -12,3 +12,3 @@ + +-#if !defined(SPDLOG_FMT_EXTERNAL) ++#if 0 + #if !defined(SPDLOG_COMPILED_LIB) && !defined(FMT_HEADER_ONLY) +diff --git a/include/spdlog/fmt/ostr.h b/include/spdlog/fmt/ostr.h +index f82eb679..ac86e3c2 100644 +--- a/include/spdlog/fmt/ostr.h ++++ b/include/spdlog/fmt/ostr.h +@@ -10,3 +10,3 @@ + +-#if !defined(SPDLOG_FMT_EXTERNAL) ++#if 0 + #ifdef SPDLOG_HEADER_ONLY diff --git a/ports/spdlog/fix-uwp.patch b/ports/spdlog/fix-uwp.patch deleted file mode 100644 index 42811122b3786a..00000000000000 --- a/ports/spdlog/fix-uwp.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 35425db..28c555a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -128,7 +128,7 @@ if(SPDLOG_FMT_EXTERNAL) - target_link_libraries(spdlog_header_only INTERFACE fmt::fmt) - - if (WIN32) -- target_compile_options(spdlog PRIVATE /wd4275) -+ target_compile_options(spdlog PRIVATE /wd4275 /wd4100) - endif() - - set(PKG_CONFIG_REQUIRES fmt) # add dependecy to pkg-config -diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h -index f436b0d..82f3510 100644 ---- a/include/spdlog/details/os-inl.h -+++ b/include/spdlog/details/os-inl.h -@@ -128,7 +128,7 @@ SPDLOG_INLINE void prevent_child_fd(FILE *f) - { - - #ifdef _WIN32 --#if !defined(__cplusplus_winrt) -+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) - auto file_handle = reinterpret_cast(_get_osfhandle(_fileno(f))); - if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0)) - SPDLOG_THROW(spdlog_ex("SetHandleInformation failed", errno)); diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index f62234090abd02..7b14a017ac42da 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -1,28 +1,39 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gabime/spdlog - REF 1549ff12f1aa61ffc4d9a8727c519034724392a0 #v1.4.2 - SHA512 c159aea475baecad0a5a9eef965856203c96aa855b0480e82d751bcc050c6e08bb0aa458544da061f5d744e17dcd27bd9b6e31a62d502834f02d3591f29febec + REF 83b9149930f392d7797b54fe97a66ab3f2120671 #v1.6.0 + SHA512 b41201e036891ef34399b387d9a04d36687f05aa420a5e324836131e217ffff0d6658a17472817534b45bed6ae10f8b780805a537cb93ffb058f17013af9b14d HEAD_REF v1.x PATCHES - disable-master-project-check.patch fix-feature-export.patch - fix-error-4275.patch - fix-uwp.patch - fix-include.patch + fix-includes-external-fmt.patch ) -set(SPDLOG_USE_BENCHMARK OFF) -if("benchmark" IN_LIST FEATURES) - set(SPDLOG_USE_BENCHMARK ON) -endif() +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + benchmark SPDLOG_BUILD_BENCH + coarse-clock SPDLOG_CLOCK_COARSE + no-atomic-levels SPDLOG_NO_ATOMIC_LEVELS + no-child-fd SPDLOG_PREVENT_CHILD_FD + no-exceptions SPDLOG_NO_EXCEPTIONS + no-local-storage SPDLOG_NO_TLS + no-thread-id SPDLOG_NO_THREAD_ID + pch SPDLOG_ENABLE_PCH + shared SPDLOG_BUILD_SHARED + wchar SPDLOG_WCHAR_SUPPORT + wchar SPDLOG_WCHAR_FILENAMES + INVERTED_FEATURES + disable-warnings SPDLOG_BUILD_WARNINGS +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DSPDLOG_MASTER_PROJECT=OFF -DSPDLOG_FMT_EXTERNAL=ON - -DSPDLOG_BUILD_BENCH=${SPDLOG_USE_BENCHMARK} + ${FEATURE_OPTIONS} -DSPDLOG_INSTALL=ON ) @@ -39,16 +50,6 @@ vcpkg_copy_pdbs() # use vcpkg-provided fmt library (see also option SPDLOG_FMT_EXTERNAL above) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/spdlog/fmt/bundled) -vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/fmt/fmt.h - "#if !defined(SPDLOG_FMT_EXTERNAL)" - "#if 0 // !defined(SPDLOG_FMT_EXTERNAL)" -) - -vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/fmt/ostr.h - "#if !defined(SPDLOG_FMT_EXTERNAL)" - "#if 0 // !defined(SPDLOG_FMT_EXTERNAL)" -) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/spdlog ${CURRENT_PACKAGES_DIR}/debug/lib/spdlog ${CURRENT_PACKAGES_DIR}/debug/include)