From 4c7eb79d72660d8e8bc8599b4c221605b527176b Mon Sep 17 00:00:00 2001 From: drfrag Date: Fri, 5 Apr 2019 20:52:43 +0200 Subject: [PATCH] - Fixed MinGW compilation. --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fc0662ca4..cddcfe85a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -400,8 +400,11 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) # Remove extra warnings when using the official DirectX headers. # Also, TDM-GCC 4.4.0 no longer accepts glibc-style printf formats as valid, # which is a royal pain. The previous version I had been using was fine with them. + # MinGW: switch to the Windows Unicode API. if( WIN32 ) set( CMAKE_CXX_FLAGS "-Wno-unknown-pragmas -Wno-comment -Wno-format ${CMAKE_CXX_FLAGS}" ) + set( CMAKE_CXX_FLAGS "-D_UNICODE -DUNICODE ${CMAKE_CXX_FLAGS}" ) + set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -municode" ) endif() # Detect FreeBSD and add flags