]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
meson: Make tests run better on MSVC builds
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 26 Jan 2022 10:22:21 +0000 (18:22 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 28 Jan 2022 08:16:43 +0000 (16:16 +0800)
Use compiler flags that would work on Visual Studio so that tests can
run much better than without.  Currently, one may need to set the
PKG_CONFIG envvar to `<pkg-config-executable> --msvc-syntax` for this to
work best.

tests/meson.build

index 1f22ddaec346f9805b0c2bf42535bc615555cac4..1c5d738c18886c06530540a4185d294b3345d6aa 100644 (file)
@@ -1371,13 +1371,23 @@ vala_flags = [
        '--disable-warnings',
        '--save-temps',
        '--cc', cc.cmd_array()[-1],
+       '-X', '-DGETTEXT_PACKAGE="valac"',
+]
+
+if cc.get_id() == 'msvc'
+vala_flags += [
+       '-X', '-Od',
+       '-X', 'gmodule-2.0.lib', # undefined reference to `g_module_open_full'
+]
+else
+vala_flags += [
        '-X', '-g',
        '-X', '-O0',
        '-X', '-pipe',
        '-X', '-lm',
        '-X', '-lgmodule-2.0', # undefined reference to `g_module_open_full'
-       '-X', '-DGETTEXT_PACKAGE="valac"',
 ]
+endif
 
 test_envars = [
        'G_DEBUG=fatal-warnings',