[atk/msvc.improvements] Visual Studio builds: Use -utf-8 if available



commit 1144ed4f4bfc69444e35330f0d36cdad66282b86
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jan 15 14:29:56 2020 +0800

    Visual Studio builds: Use -utf-8 if available
    
    This avoids the build erroring out on C4819 (Unicode handling issue in the Visual
    Studio compiler), which notably occurs on Chinese, Korean and Japanese locales.

 meson.build | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 6dab01f..b2dbb6e 100644
--- a/meson.build
+++ b/meson.build
@@ -43,8 +43,15 @@ darwin_versions = ['@0@'.format(current + 1), '@0@.@1@'.format(current + 1, atk_
 
 add_project_arguments([ '-DG_DISABLE_SINGLE_INCLUDES', '-DATK_DISABLE_SINGLE_INCLUDES' ], language: 'c')
 
+project_c_args = []
 if cc.get_id() == 'msvc'
-  add_project_arguments([ '-FImsvc_recommended_pragmas.h' ], language: 'c')
+  project_c_args += [
+    '-FImsvc_recommended_pragmas.h',
+    '-utf-8',
+  ]
+
+  project_c_args = cc.get_supported_arguments(project_c_args)
+  add_project_arguments(project_c_args, language: 'c')
 endif
 
 # Compiler and linker flags


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]