Tell MSVC source files are in UTF-8 format
On some locales (e.g. Japanese) MSVC will fail to build Furnace because it makes an incorrect assumption about the encoding of source files. In particular, string literals in engine.cpp cause compile errors. This probably doesn't show up in CI because of the difference in locale. This patch adds the `/source-charset:utf-8` compiler flag for MSVC, which tells it the encoding of the source files. With this change, MSVC appears to build Furnace properly. Tested with Visual Studio Professional 2022.
This commit is contained in:
parent
f56d771a4d
commit
dbed326a58
|
@ -339,6 +339,7 @@ if (NOT MSVC)
|
|||
endif()
|
||||
else()
|
||||
# /wd4100 == -Wno-unused-parameter
|
||||
add_compile_options("/source-charset:utf-8")
|
||||
set(WARNING_FLAGS /W4 /wd4100 /D_CRT_SECURE_NO_WARNINGS)
|
||||
if (WARNINGS_ARE_ERRORS)
|
||||
list(APPEND WARNING_FLAGS /WX)
|
||||
|
|
Loading…
Reference in New Issue