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}")