From 24f20af0cd01f94cc7bfe4051ab46300a27e8082 Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Mon, 27 Dec 2021 22:41:21 +0100 Subject: [PATCH] build(msvc): always assume source files are in UTF-8 Fixes https://github.com/ARMmbed/mbedtls/issues/4205 Signed-off-by: Andrea Pappacoda (cherry picked from commit 9202909d071e708770fc61437d11e3a9be2b04b9) --- CMakeLists.txt | 4 ++-- ChangeLog.d/cmake_msvc_utf8.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 ChangeLog.d/cmake_msvc_utf8.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 14ca7b696..9185d4ffc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,8 +226,8 @@ if(CMAKE_COMPILER_IS_IAR) endif(CMAKE_COMPILER_IS_IAR) if(CMAKE_COMPILER_IS_MSVC) - # Strictest warnings - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + # Strictest warnings, UTF-8 source and execution charset + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3 /utf-8") endif(CMAKE_COMPILER_IS_MSVC) if(MBEDTLS_FATAL_WARNINGS) diff --git a/ChangeLog.d/cmake_msvc_utf8.txt b/ChangeLog.d/cmake_msvc_utf8.txt new file mode 100644 index 000000000..552eec752 --- /dev/null +++ b/ChangeLog.d/cmake_msvc_utf8.txt @@ -0,0 +1,2 @@ +Changes + * Assume source files are in UTF-8 when using MSVC with CMake.