From 76fcc5bc3d1b7e60955782766ec982286c7ab4c2 Mon Sep 17 00:00:00 2001 From: Sewbacca Date: Tue, 28 Nov 2023 16:11:07 +0100 Subject: [PATCH] MinGW: Support utf-16 encoded love.rc --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9eddd07cb..dfb44de92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1777,6 +1777,12 @@ if(MSVC OR MINGW) extra/windows/love.rc extra/windows/love.ico ) + + if(MINGW) + # UTF-16 flags passed to windres. windres invokes gcc as preprocessor + # -> gcc outputs utf8, so windres must read-in codepage 65001 (utf8) + set(CMAKE_RC_FLAGS ${CMAKE_RC_FLAGS} "-c 65001 --preprocessor-arg=-finput-charset=UTF-16LE") + endif() endif() add_library(${LOVE_LIB_NAME} SHARED ${LOVE_LIB_SRC} ${LOVE_RC})