[spdlog] Use std::format by default (#48891)

This commit is contained in:
Giuseppe Roberti 2025-12-16 19:55:14 +01:00 committed by GitHub
parent 2b6a882f61
commit b205c4a7f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 31 additions and 7 deletions

View File

@ -9,7 +9,10 @@ vcpkg_from_github(
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
benchmark SPDLOG_BUILD_BENCH
fmt SPDLOG_FMT_EXTERNAL
wchar SPDLOG_WCHAR_SUPPORT
INVERTED_FEATURES
fmt SPDLOG_USE_STD_FORMAT
)
# SPDLOG_WCHAR_FILENAMES can only be configured in triplet file since it is an alternative (not additive)
@ -26,7 +29,6 @@ vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DSPDLOG_FMT_EXTERNAL=ON
-DSPDLOG_INSTALL=ON
-DSPDLOG_BUILD_SHARED=${SPDLOG_BUILD_SHARED}
-DSPDLOG_WCHAR_FILENAMES=${SPDLOG_WCHAR_FILENAMES}
@ -43,10 +45,18 @@ if(NOT VCPKG_BUILD_TYPE)
endif()
# add support for integration other than cmake
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h
"// #define SPDLOG_FMT_EXTERNAL"
"#ifndef SPDLOG_FMT_EXTERNAL\n#define SPDLOG_FMT_EXTERNAL\n#endif"
)
if(SPDLOG_FMT_EXTERNAL)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h
"// #define SPDLOG_FMT_EXTERNAL"
"#ifndef SPDLOG_FMT_EXTERNAL\n#define SPDLOG_FMT_EXTERNAL\n#endif"
)
endif()
if(SPDLOG_USE_STD_FORMAT)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h
"// #define SPDLOG_USE_STD_FORMAT"
"#ifndef SPDLOG_USE_STD_FORMAT\n#define SPDLOG_USE_STD_FORMAT\n#endif"
)
endif()
if(SPDLOG_WCHAR_SUPPORT)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h
"// #define SPDLOG_WCHAR_TO_UTF8_SUPPORT"

View File

@ -1,11 +1,11 @@
{
"name": "spdlog",
"version-semver": "1.16.0",
"port-version": 1,
"description": "Very fast, header-only/compiled, C++ logging library.",
"homepage": "https://github.com/gabime/spdlog",
"license": "MIT",
"dependencies": [
"fmt",
{
"name": "vcpkg-cmake",
"host": true
@ -15,6 +15,9 @@
"host": true
}
],
"default-features": [
"fmt"
],
"features": {
"benchmark": {
"description": "Use google benchmark",
@ -22,6 +25,12 @@
"benchmark"
]
},
"fmt": {
"description": "Use fmt library",
"dependencies": [
"fmt"
]
},
"wchar": {
"description": "Build with wchar_t (Windows only)",
"supports": "windows"

View File

@ -9278,7 +9278,7 @@
},
"spdlog": {
"baseline": "1.16.0",
"port-version": 0
"port-version": 1
},
"spectra": {
"baseline": "1.0.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "33853c1dc569252eb1df77164b3357d63fc15cb6",
"version-semver": "1.16.0",
"port-version": 1
},
{
"git-tree": "5e6886c421877c656b6be701880e2cbe2bc16131",
"version-semver": "1.16.0",