[grilo/master.msvc: 2/13] meson: Add some MSVC-specific items



commit 40ca043597e17c4521b8d1ec1495db5170da4295
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Apr 22 12:16:52 2020 +0800

    meson: Add some MSVC-specific items
    
    This makes use of GLib's msvc_recommended_pragmas.h and the compiler's -utf-8
    flag, which will help us during the build.

 meson.build | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 263cd66..999a655 100644
--- a/meson.build
+++ b/meson.build
@@ -48,8 +48,14 @@ gmodule_dep = dependency('gmodule-2.0', version: glib2_required_info, required:
 gobject_dep = dependency('gobject-2.0', version: glib2_required_info, required: true)
 libxml_dep = dependency('libxml-2.0', required: cc.get_argument_syntax() != 'msvc')
 
-if cc.get_argument_syntax() == 'msvc' and not libxml_dep.found()
-  libxml_dep = cc.find_library('libxml2', has_headers: [ 'libxml/parser.h' ])
+if cc.get_argument_syntax() == 'msvc'
+  if cc.get_id() == 'msvc'
+    add_project_arguments(cc.get_supported_arguments(['/FImsvc_recommended_pragmas.h', '/utf-8']),
+                          language : 'c')
+  endif
+  if not libxml_dep.found()
+    libxml_dep = cc.find_library('libxml2', has_headers: [ 'libxml/parser.h' ])
+  endif
 endif
 
 enable_grlnet = get_option('enable-grl-net')


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