From c96906d84dd6a1c40ea797ad542df3a0c47307a3 Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Fri, 30 Aug 2024 20:04:04 +0900 Subject: [PATCH] cmake : set MSVC to use UTF-8 on source files (#2346) --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb17def7d40..35f2f85bdd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,11 @@ if (NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() +# If MSVC set utf-8 encoding +if (MSVC) + add_compile_options(/utf-8) +endif() + # Add path to modules list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")