[vala/meson-msvc] meson: Make tests run better on MSVC builds



commit 42a52b2c9cd31d24c7cb7802bcc64ee0a6cbae7c
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jan 26 18:22:21 2022 +0800

    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 `<pkg-config-executable> --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 1c27c02f9..fa0bc6bb5 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1367,13 +1367,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',


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