MSVC: Fix compiling with some system languages
authorCampbell Barton <ideasman42@gmail.com>
Sun, 10 Dec 2017 04:12:31 +0000 (15:12 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 10 Dec 2017 04:19:50 +0000 (15:19 +1100)
Report from @cyaoeu that compiling failed for Japanese system language.

build_files/cmake/platform/platform_win32.cmake

index 146412e556b597c61bb19aafc8580a0ebb49016e..4b444e63ebdb2432f914129d90c55dcdee79b180 100644 (file)
@@ -52,6 +52,11 @@ macro(find_package_wrapper)
 endmacro()
 
 add_definitions(-DWIN32)
+
+# Needed, otherwise system encoding causes utf-8 encoding to fail in some cases (C4819)
+add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
+add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
+
 # Minimum MSVC Version
 if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
        if(MSVC_VERSION EQUAL 1800)