From 2d4d8a13c2b48e598020089f9003c3da0f2802e5 Mon Sep 17 00:00:00 2001 From: Ethan Stoner Date: Sun, 6 Sep 2026 13:46:11 -0700 Subject: [PATCH] Build nolocale-test with /utf-8 on MSVC (#4919) nolocale-test compiles src/format.cc directly, so it does not pick up the /utf-8 that CMakeLists.txt adds to the fmt target. On MSVC the static_assert in base.h then fires: "Unicode support requires compiling with /utf-8". The target only exists under FMT_PEDANTIC, which the Windows workflow does not set, so this has not shown up in CI. unicode-test already guards the same flag the same way. --- test/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c36ba396..446261d8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -134,6 +134,8 @@ if (FMT_PEDANTIC) PRIVATE ${PROJECT_SOURCE_DIR}/include) target_compile_definitions(nolocale-test PRIVATE FMT_STATIC_THOUSANDS_SEPARATOR=1) + target_compile_options(nolocale-test + PRIVATE $<$:/utf-8>) endif () # These tests are disabled on Windows because they take too long.