From 734b60dd8c249618b63712c99e17201a596fee26 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 26 Jan 2022 18:22:21 +0800 Subject: [PATCH] meson: Make tests run better on MSVC builds 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 ` --msvc-syntax` for this to work best. --- tests/meson.build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/meson.build b/tests/meson.build index 1f22ddaec..1c5d738c1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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', -- 2.47.2