pass /utf-8 only when compiler is MSVC (#3260)

This commit is contained in:
miyanyan 2024-11-22 17:42:35 +08:00 committed by GitHub
parent 1245bf8e8a
commit 9edab1b5a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()