From ebfa9069524968a045e35d8d323ec5d6ee2fb8a8 Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Fri, 8 Nov 2024 11:16:06 +0200 Subject: [PATCH] CMake option to Enable/disable msvc /utf-8 flag (on by default) --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ce37de2..c5bc7b88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,15 +108,17 @@ endif() if(WIN32) option(SPDLOG_WCHAR_SUPPORT "Support wchar api" OFF) option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF) - option(SPDLOG_WCHAR_CONSOLE "Support wchar output to console" OFF) - # the "/utf-8" compiler flag required by fmt 11.x under msvc - option(SPDLOG_MSVC_UTF8 "Enable/disable msvc /utf-8 flag required by fmt lib" ON) + option(SPDLOG_WCHAR_CONSOLE "Support wchar output to console" OFF) else() set(SPDLOG_WCHAR_SUPPORT OFF CACHE BOOL "non supported option" FORCE) set(SPDLOG_WCHAR_FILENAMES OFF CACHE BOOL "non supported option" FORCE) set(SPDLOG_WCHAR_CONSOLE OFF CACHE BOOL "non supported option" FORCE) endif() +if(MSVC) + option(SPDLOG_MSVC_UTF8 "Enable/disable msvc /utf-8 flag required by fmt lib" ON) +endif() + if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") option(SPDLOG_CLOCK_COARSE "Use CLOCK_REALTIME_COARSE instead of the regular clock," OFF) else()