Skip to content

Commit 8ca2e97

Browse files
authored
[build] Add /utf-8 build if MSVC (#8926)
Add the /utf-8 flag if building on Windows. This is necessary when building the fmt library. Signed-off-by: Schuyler Eldridge <[email protected]>
1 parent ac490f1 commit 8ca2e97

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
3535
# Options and settings
3636
#-------------------------------------------------------------------------------
3737

38+
# MSVC-specific compiler configuration
3839
if (MSVC)
3940
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c- /GR-")
41+
# Enable UTF-8 support for source files and string literals. This is
42+
# required by dependencies like fmt library.
43+
string(APPEND CMAKE_CXX_FLAGS " /utf-8")
44+
string(APPEND CMAKE_C_FLAGS " /utf-8")
4045
else ()
4146
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
4247
endif ()

0 commit comments

Comments
 (0)