meson: Fix build with MSVC and non-English locale
authorSeungha Yang <seungha.yang@navercorp.com>
Mon, 20 May 2019 15:22:36 +0000 (00:22 +0900)
committerSeungha Yang <seungha.yang@navercorp.com>
Mon, 20 May 2019 15:28:43 +0000 (00:28 +0900)
Otherwise, MSVC will complain and cause build error.

meson.build

index 72f90d7..c685e41 100644 (file)
@@ -29,6 +29,12 @@ cc = meson.get_compiler('c')
 
 syslibs = []
 
+if cc.get_id() == 'msvc'
+  add_project_arguments(
+      cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
+      language : 'c')
+endif
+
 if host_machine.system() == 'windows'
   syslibs += [cc.find_library('iphlpapi')]
   syslibs += [cc.find_library('ws2_32')]