From f09ae987bffc2ede00341bc6f0e903ae6810def5 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 5 Aug 2019 13:51:09 +0300 Subject: [PATCH] build: Skip building some tests on MSVC for now This is a stopgap measure to quickly get tests building with MSVC for now, at some point the tests could be rewritten to avoid using getopt() and mkdtemp() or to ship an implementation. --- meson.build | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index d8b9430..a43fc0c 100644 --- a/meson.build +++ b/meson.build @@ -344,11 +344,14 @@ test( executable('test-filecomp', 'test/filecomp.c', dependencies: test_dep), env: test_env, ) -test( - 'context', - executable('test-context', 'test/context.c', dependencies: test_dep), - env: test_env, -) +# TODO: This test currently uses some functions that don't exist on Windows. +if cc.get_id() != 'msvc' + test( + 'context', + executable('test-context', 'test/context.c', dependencies: test_dep), + env: test_env, + ) +endif test( 'rules-file', executable('test-rules-file', 'test/rules-file.c', dependencies: test_dep), @@ -427,9 +430,11 @@ executable('fuzz-compose', 'fuzz/compose/target.c', dependencies: test_dep) # Demo programs. -executable('rmlvo-to-kccgst', 'test/rmlvo-to-kccgst.c', dependencies: test_dep) -executable('rmlvo-to-keymap', 'test/rmlvo-to-keymap.c', dependencies: test_dep) -executable('print-compiled-keymap', 'test/print-compiled-keymap.c', dependencies: test_dep) +if cc.has_header_symbol('getopt.h', 'getopt_long', prefix: '#define _GNU_SOURCE') + executable('rmlvo-to-kccgst', 'test/rmlvo-to-kccgst.c', dependencies: test_dep) + executable('rmlvo-to-keymap', 'test/rmlvo-to-keymap.c', dependencies: test_dep) + executable('print-compiled-keymap', 'test/print-compiled-keymap.c', dependencies: test_dep) +endif if cc.has_header('linux/input.h') executable('interactive-evdev', 'test/interactive-evdev.c', dependencies: test_dep) endif -- 2.7.4