mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 02:11:39 +08:00
[spdlog] Improve macro baking (#24830)
- correct vcpkg feature `wchar` - add support for integrations other than cmake - update port-version + vcpkg x-add-version spdlog
This commit is contained in:
parent
b2afb50afe
commit
840f701d83
@ -12,14 +12,14 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
wchar SPDLOG_WCHAR_SUPPORT
|
||||
)
|
||||
|
||||
# configured in triplet file
|
||||
# SPDLOG_WCHAR_FILENAMES can only be configured in triplet file since it is an alternative (not additive)
|
||||
if(NOT DEFINED SPDLOG_WCHAR_FILENAMES)
|
||||
set(SPDLOG_WCHAR_FILENAMES OFF)
|
||||
endif()
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
if("wchar" IN_LIST FEATURES)
|
||||
message(WARNING "Feature 'wchar' is only supported for Windows and has no effect on other platforms.")
|
||||
elseif(SPDLOG_WCHAR_FILENAMES)
|
||||
elseif(SPDLOG_WCHAR_FILENAMES)
|
||||
message(FATAL_ERROR "Build option 'SPDLOG_WCHAR_FILENAMES' is for Windows.")
|
||||
endif()
|
||||
endif()
|
||||
@ -45,10 +45,23 @@ 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)
|
||||
|
||||
# add support for integration other than cmake
|
||||
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h
|
||||
"// #define SPDLOG_FMT_EXTERNAL"
|
||||
"#define SPDLOG_FMT_EXTERNAL"
|
||||
"#ifndef SPDLOG_FMT_EXTERNAL\n#define SPDLOG_FMT_EXTERNAL\n#endif"
|
||||
)
|
||||
if(SPDLOG_WCHAR_SUPPORT)
|
||||
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h
|
||||
"// #define SPDLOG_WCHAR_TO_UTF8_SUPPORT"
|
||||
"#ifndef SPDLOG_WCHAR_TO_UTF8_SUPPORT\n#define SPDLOG_WCHAR_TO_UTF8_SUPPORT\n#endif"
|
||||
)
|
||||
endif()
|
||||
if(SPDLOG_WCHAR_FILENAMES)
|
||||
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h
|
||||
"// #define SPDLOG_WCHAR_FILENAMES"
|
||||
"#ifndef SPDLOG_WCHAR_FILENAMES\n#define SPDLOG_WCHAR_FILENAMES\n#endif"
|
||||
)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include
|
||||
${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "spdlog",
|
||||
"version-semver": "1.10.0",
|
||||
"port-version": 1,
|
||||
"description": "Very fast, header only, C++ logging library",
|
||||
"homepage": "https://github.com/gabime/spdlog",
|
||||
"license": "MIT",
|
||||
|
2
versions/baseline.json
Normal file → Executable file
2
versions/baseline.json
Normal file → Executable file
@ -6690,7 +6690,7 @@
|
||||
},
|
||||
"spdlog": {
|
||||
"baseline": "1.10.0",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"spectra": {
|
||||
"baseline": "1.0.1",
|
||||
|
5
versions/s-/spdlog.json
Normal file → Executable file
5
versions/s-/spdlog.json
Normal file → Executable file
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "3256ea88cc375fda2f977a2eb18435e23d498572",
|
||||
"version-semver": "1.10.0",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "1ac795913d88241171b45d796d3fe5dd38519d5a",
|
||||
"version-semver": "1.10.0",
|
||||
|
Loading…
Reference in New Issue
Block a user