Build nolocale-test with /utf-8 on MSVC - #4919
Open
ethanstoner wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nolocale-testdoes not compile with MSVC whenFMT_PEDANTICis on:The target is built from
../src/format.ccdirectly (test/CMakeLists.txt:132), so it does not pick up the/utf-8thatCMakeLists.txt:255adds to thefmttarget.unicode-testalready guards the same flag the same way attest/CMakeLists.txt:73-75, so this follows that.It has not shown up in CI because the target only exists under
FMT_PEDANTIC, andwindows.ymldoes not set it, whilelinux.yml:211-212andmacos.yml:46both do.Checked at C++20 and C++23 with MSVC 19.44, since I wondered whether it was standard-specific. It is not, it fails at both. After the change the full build succeeds and
ctestis 23/23 withFMT_PEDANTIC=ON.Disclosure: written with AI assistance. The build output above is from my own machine.