[spdlog] use '/utf-8' only when compiler is msvc (#42211)

This commit is contained in:
miyanyan 2024-11-19 13:29:54 +08:00 committed by GitHub
parent e162a133c8
commit 5dddb82a39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5bc7b8..2fcdfff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -274,8 +274,8 @@ if(MSVC)
target_compile_options(spdlog PRIVATE "/Zc:__cplusplus")
target_compile_options(spdlog_header_only INTERFACE "/Zc:__cplusplus")
if(SPDLOG_MSVC_UTF8)
- target_compile_options(spdlog PUBLIC "/utf-8")
- target_compile_options(spdlog_header_only INTERFACE "/utf-8")
+ target_compile_options(spdlog PUBLIC $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>)
+ target_compile_options(spdlog_header_only INTERFACE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>)
endif()
endif()

View File

@ -4,6 +4,8 @@ vcpkg_from_github(
REF "v${VERSION}"
SHA512 3dd98409f4625ae4d46ef5f59a2fc22a6e151a13dba9d37433363e5d84eab7cca73b379eeb637d8f9b1f0f5a42221c0cc9a2a70414dc2b6af6a162e19fba0647
HEAD_REF v1.x
PATCHES
fix-msvc-utf8.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

View File

@ -1,6 +1,7 @@
{
"name": "spdlog",
"version-semver": "1.15.0",
"port-version": 1,
"description": "Very fast, header-only/compiled, C++ logging library.",
"homepage": "https://github.com/gabime/spdlog",
"license": "MIT",

View File

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

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "72b3738962d622e47073cf4a0dc0e6ddd29d1544",
"version-semver": "1.15.0",
"port-version": 1
},
{
"git-tree": "6595ef6c86cf6618cede07b4e1bc8b4d6b098b45",
"version-semver": "1.15.0",