diff --git a/CMakeLists.txt b/CMakeLists.txt index 365c023e46..c5ac6f6e85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -821,6 +821,13 @@ endif() set(TINYGETTEXT_WO_ICONV ON) add_subdirectory(core/deps/tinygettext EXCLUDE_FROM_ALL) +if(MSVC) + # language.cpp holds the native language names as non-ASCII literals. MSVC + # decodes sources without a BOM using the active code page, so on a non-UTF-8 + # system locale those literals break the build (C2001/C2064). The main target + # already passes /utf-8; this dependency needs it too. + target_compile_options(tinygettext PRIVATE /utf-8) +endif() target_include_directories(${PROJECT_NAME} PRIVATE core/deps/tinygettext/include) target_link_libraries(${PROJECT_NAME} PRIVATE tinygettext::tinygettext)