Skip to content

Commit 342397d

Browse files
cmake: force MSVC compiler charset to utf-8 (ggml-org#9989)
1 parent 2a11b6b commit 342397d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ if (WIN32)
4646
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
4747
endif()
4848

49+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
50+
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/source-charset:utf-8>")
51+
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/source-charset:utf-8>")
52+
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/execution-charset:utf-8>")
53+
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/execution-charset:utf-8>")
54+
endif()
55+
4956
#
5057
# option list
5158
#

0 commit comments

Comments
 (0)