← Back to team overview

kicad-developers team mailing list archive

[PATCH 2/3] Genericize Unicode switch on Windows

 

Both UNICODE and _UNICODE are required, on all Windows compilers.
---
 CMakeLists.txt | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c835aaeab..5ce1048736 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -182,6 +182,9 @@ perform_feature_checks()
 
 
 if( WIN32 )
+    # Enable Unicode on Windows. Both definitions are required
+    add_definitions(-DUNICODE -D_UNICODE)
+
     # Enable definitions for M_PI et al.
     add_definitions(-D_USE_MATH_DEFINES)
 endif()
@@ -314,13 +317,6 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
     if( MINGW )
         set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
 
-        # _UNICODE definition seems needed under mingw/gcc 4.8
-        # (KiCad uses unicode, and on Windows, wxWidgets >= 2.9.4 is mandatory
-        # and uses unicode)
-        if( GCC_VERSION VERSION_EQUAL 4.8.0 OR GCC_VERSION VERSION_GREATER 4.8.0 )
-            add_definitions(-D_UNICODE)
-        endif()
-
         # Since version 2.8.5, Cmake uses a response file (.rsp) to
         # pass the list of include paths to gcc
         # unfortunately, under mingw32+msys, at least with gcc 4.8 and previous,

References