Make nolocale-test actually disable locale (#4939)

nolocale-test defines FMT_STATIC_THOUSANDS_SEPARATOR, which stopped doing
anything in b90b4bc9 ("Remove FMT_STATIC_THOUSANDS_SEPARATOR in favor of
FMT_USE_LOCALE"). That macro no longer appears anywhere under include/, so
since then the target has compiled src/format.cc with locale support enabled.

It is not a dead target: the pedantic CI jobs build it (linux.yml, macos.yml
both pass -DFMT_PEDANTIC=ON), and it passes. So the configuration looks
covered while nothing actually tests it. #4627 - a locale-off build break -
landed during that window.

Define FMT_USE_LOCALE=0 instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Tiago 2026-09-11 12:39:06 -07:00 committed by GitHub
parent 14174c826d
commit e5d13d826f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,8 +132,7 @@ if (FMT_PEDANTIC)
add_library(nolocale-test ../src/format.cc)
target_include_directories(nolocale-test
PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_compile_definitions(nolocale-test
PRIVATE FMT_STATIC_THOUSANDS_SEPARATOR=1)
target_compile_definitions(nolocale-test PRIVATE FMT_USE_LOCALE=0)
target_compile_options(nolocale-test
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/utf-8>)
endif ()