From 8de3e87da1f3088963944633fded6c639559ab64 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 9 Jun 2024 11:05:05 -0700 Subject: [PATCH] Add a CMake option to control Unicode support --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4d93ece..db6e1887 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,7 @@ option(FMT_CUDA_TEST "Generate the cuda-test target." OFF) option(FMT_OS "Include OS-specific APIs." ON) option(FMT_MODULE "Build a module instead of a traditional library." OFF) option(FMT_SYSTEM_HEADERS "Expose headers with marking them as system." OFF) +option(FMT_UNICODE "Enable Unicode support." ON) if (FMT_TEST AND FMT_MODULE) # The tests require {fmt} to be compiled as traditional library @@ -347,7 +348,7 @@ endif () add_library(fmt-header-only INTERFACE) add_library(fmt::fmt-header-only ALIAS fmt-header-only) -if (MSVC) +if (MSVC AND FMT_UNICODE) # Unicode support requires compiling with /utf-8. target_compile_options(fmt PUBLIC /utf-8) target_compile_options(fmt-header-only INTERFACE /utf-8)