From c80628cebf4765714ca6c45c7efd0471a7c0381b Mon Sep 17 00:00:00 2001 From: taynpg Date: Sun, 5 Jan 2025 21:58:45 +0800 Subject: [PATCH] =?UTF-8?q?mingw=EF=BC=9A=E7=BC=96=E8=AF=91=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E6=B7=BB=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65a40c0..a156c3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) if (MSVC) add_compile_options(/source-charset:utf-8) endif() +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") + MESSAGE(STATUS "Add MinGW Param.") + add_compile_options(-finput-charset=utf-8) + add_compile_options(-fexec-charset=gbk) +endif() message(STATUS "System: ${CMAKE_SYSTEM_NAME}") message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")